[BUG] Error: Cannot find module 'tslib'
See original GitHub issueDescribe the bug
Hi! First of all: Thank you for providing this great library. With the update to the latest patch version of fast-csv, I started to get some error messages when trying to import the library:
Error: Cannot find module 'tslib'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> xxx/node_modules/@fast-csv/format/build/src/index.js:4:17)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
I assume, this is down to the following change in your tsconfig: https://github.com/C2FO/fast-csv/commit/666800653811b54bd32c5afb59b9ef146ac7828e#diff-17d19956339a21e53394cda05f5a6cc3R9
You added "importHelpers": true
which will (as I found out) Import emit helpers from 'tslib'
. Yet, tslib is not defined as a dependency, so I assume this compiler option emits some code that fails at runtime if the dependency is not present.
Parsing or Formatting?
- Formatting
- Parsing
To Reproduce
I’ll update with a mwe, currently building one
Expected behavior
Importing the library should be possible without having to require tslib myself explicitly.
Desktop (please complete the following information):
- OS: Windows
- OS Version 10
- Node Version 10.18.1
(But also my Jenkins, which runs on Linux, but I don’t know exact version there)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:10 (2 by maintainers)
Top GitHub Comments
Looks like I may have been running into a caching issue with GAE and node. Running
gcloud beta app deploy --no-cache
solved the issue for me on version
4.2.0
. Thanks for your quick responses and fixes.@doug-martin Stuff like this happens… Thank you for fixing this so fast! 😃