Node 16 + 18 ESM import errors
Closed this issue · 4 comments
Before opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- I acknowledge that I will attach a full debug log, otherwise the issue will be closed with no response.
Environment information
# Put output below this line
Describe the bug
On node 16.13.1 I get:
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".json" for /Users/xxxx/node_modules/cypress/package.json
Is node 17+ a requirement?
On node 18.15.0
TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///Users/xxxxx/node_modules/cypress/package.json" needs an import assertion of type "json"
https://github.com/lpanger/cypress-cloud-module-api
cypress-cloud 1.4.5-beta.1
cypress 12.8.1
clone repo and run node index.js
Expected behavior
Importing ESM modules should not throw on major node versions
Command and Setup
N/A
Full log and debug output
// Put your logs below this line
@lpanger
The issue should be resolved in 1.4.5-beta.2
npm i cypress-cloud@1.4.5-beta.2
Please note, https://github.com/lpanger/cypress-cloud-module-api/blob/main/index-import-file.js is not supposed to work because no such entry point exists.
Please confirm it's working for you, I'll cut a latest release
Thanks @agoldis. Preliminary review looks good!
FYI the import file option was just testing.
Awesome! Released 1.5.0