Cannot find module 'strtok3/core' from 'node_modules/file-type/core.js'
See original GitHub issueHello,
I have version 17.1.2 installed in a project.
When I attempt to use this library I get the error Cannot find module 'strtok3/core' from 'node_modules/file-type/core.js'
This seems to be caused by core.js:3 referencing strtok3/core
instead of strtok3/lib/core
.
Maybe this is a problem with my local setup, but wanted to see if there was an easy resolution to this issue.
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:7
Top Results From Across the Web
Unable to get file-type to run in browser (modules strtok3/core ...
file-type version 17.1.1, webpack version 4.44.2. we have used solution from 502 to solve node:buffer error to run the library in browser.
Read more >strtok3 - npm
A promise based streaming tokenizer for Node.js and browsers. This node module is a successor of strtok2. The strtok3 contains a few methods...
Read more >Importing pure ESM module in TS project fails Jest test with ...
I have made a sandbox here. Summary of my code: import { fileTypeFromBuffer } from "file-type";. Jest config ...
Read more >[SOLVED] Unable to resolve some modules: "node:fs" - help
Edit: Got the error when import file-type package import { fileTypeFromFile } ... "strtok3/core" in /banana/node_modules/file-type/core.js ...
Read more >cannot find module or its corresponding type declarations file
Every error is the same: Cannot find module 'node:stream' or its corresponding type declarations. and it occurs in 5 places: node_modules/file-type/core.d.ts:1: ...
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 Free
Top 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
also facing the same issue after updating from 16.4.0 to 17.1.4
UPDATE: I just wanted to update this dependency because of the security issue wit the malformed mkv file. I just found out that npm audit can also fix this issue by bumping the sub-dependency:
npm update file-type --depth 1
Issue solved for me.
The path ‘strtok3/core’ was wrong indeed, sorry issue was hard to distinct from the many basic ESM issues. Issue fixed by: