Cannot find module './types/standard' from 'index.js'
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.5.0
- Platform / OS version: Windows 7
- URLs (if applicable): repo
- Node.js version: 10.4.0
What steps will reproduce the problem?
Please include code that reproduces the issue.
- upgrade puppeteer from 1.1.1 to 1.5.0 version
- run test: ````npm test App1```
What is the expected result? to run puppeteer
What happens instead? error:
Cannot find module './types/standard' from 'index.js'
at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:210:17)
at Object.<anonymous> (../node_modules/puppeteer/node_modules/mime/index.js:4:27)
if I return to 1.1.1 version - puppeteer runs and pass the test
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Issues - GitHub
Cannot find module './types/standard' from 'index.js' #2754 ... The error itself doesn't relate to puppeteer: instead it has something to do ...
Read more >0 - Stack Overflow
Error: Cannot find module './index.ts' when doing npm start with a package import · javascript · node.js · npm · npm-install · package.json....
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
The module (package) not found is always specified in the format "Module not found: Error: Can't resolve 'package name' in 'project directory".
Read more >I have an error it says: Error: Cannot find module '.env'
[nodemon] starting node ./index.js node:internal/modules/cjs/loader:936 throw err; ^ Error: Cannot find module '.env' Require stack: ...
Read more >Error: Cannot find module - Render community
Hello community, I have a problem with my first deployment of the express application in render.com, the console shows an error Error: The ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cause: The error happens because puppeteer v1.5 started to use
mime@2.x
: https://github.com/GoogleChrome/puppeteer/commit/37cc9f567d9c2d8da1eeb630d13202e95a48cbed#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R32).in
mime@2.x
they added arequire
to a JSON file: https://github.com/broofa/node-mime/blob/master/index.js#L4Most “copy-paste” Jest configurations doesn’t support loading JSONs as-is, so that’s probably the cause.
To solve the problem: Simply add “json” to the
moduleFileExtensions
entry in thejest
property in yourpackage.json
file.- You probably already have other extensions there, so make sure not to remove them but to add “json” in addition.
Also had the same error and downgrading worked. Is there no other fix though?