You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from version 4 to 5, getting this error
Error: Must use import to load ES Module: /app/available_modules/1620488012000/p-timeout/index.js
require() of ES modules is not supported.
require() of /app/available_modules/1620488012000/p-timeout/index.js from /app/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /app/available_modules/1620488012000/p-timeout/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /app/available_modules/1620488012000/p-timeout/package.json.
Since the project is using require instead of import, but after adding import statement in commonJS files
import pTimeout from 'p-timeout'
^^^^^^
SyntaxError: Cannot use import statement outside a module
converting the whole project to type: module in package.json will require all the files to be converted
So is there any other way to import the new version or should stick I for version 4 only, also what about future fixes which gets pushed on version 5?
The text was updated successfully, but these errors were encountered:
node: 14.16.1
p-timeout: 5.0.0
After upgrading from version 4 to 5, getting this error
Since the project is using
require
instead ofimport
, but after adding import statement in commonJS filesconverting the whole project to type: module in package.json will require all the files to be converted
So is there any other way to import the new version or should stick I for version 4 only, also what about future fixes which gets pushed on version 5?
The text was updated successfully, but these errors were encountered: