Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Error: While trying to resolve module `@apollo/client` from file

1 delete node_module
2 delete yarn.lock or pakage.jason.lock
3 rm -rf /tmp/metro-*
 
4 add this in to metro.config.js
 module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: true,
      },
    }),
  },
  resolver: {
    sourceExts: ['jsx', 'js', 'ts', 'tsx', "cjs"], //add here

  },
};

5 yarn install
 
PREVIOUS NEXT
Tagged: #While #resolve #module #file
ADD COMMENT
Topic
Name
6+6 =