Move to "import" broke things
See original GitHub issuetypescript compiles fine, but I get these errors when I run. I am not willing to change package.json
to make this work.
node:internal/modules/cjs/loader:1109
throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/mesoic/Desktop/chainlink/node-operator-management/pegswap/node_modules/log-symbols/index.js
require() of ES modules is not supported.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Repaired Goods: Import and Reexport - Shipping Solutions
Contact your broker and discuss the steps you and your customer should take to import the goods for repair. This will lay the...
Read more >Importing into the United States A Guide for Commercial ...
Imported goods are not legally entered until after the shipment has arrived within the port of entry, delivery of the merchandise has been...
Read more >Traps for the Unwary in Python's Import System
Even though 3.3 cleaned up a lot of things, it still has to deal with ... to broken imports (either failing to find...
Read more >Importing Packages in Go - DigitalOcean
This program first imports the math/rand package on the third line, then moves into a for loop which that will run 10 times....
Read more >VSCode: Could not import Golang package - Stack Overflow
Make sure your tools are up to date: run ctrl + shift + p , type Go and chose Install/Update tools . Try...
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
I don’t think this issue should have been closed.
After reading the release notes we get:
even after following the instruction there, I could not get my package to work as ESM. Even if one can afford to completely re-vamp their project and move away from CommonJS and assuming all the libraries you have work with the change (not all will), there are cases where this does not work. If you are using this tool to build a CLI for example, then new package won’t be installed as an executable when using
-g
.I think at least bug fixes should be ported to
v4
as it works with CommonJS. I ended up installing"log-symbols": "4.1.0"
When I am trying to import ‘log-symbols’:
import logSymbols from 'log-symbols';
I am getting an error:
import chalk from ‘chalk’; ^^^^^^
SyntaxError: Cannot use import statement outside a module