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
I just installed this package, which by the way, seems to be the only one that does truncation and is currently maintained.
However, I have an issue while using this package inside my Next.Js application (in Typescript).
Here is how I import the package :
importcliTruncatefrom"cli-truncate";// I also triedimport*ascliTruncatefrom"cli-truncate";
And here is the error on runtime:
Error: Must use import to load ES Module: D:\workspace\my-app\node_modules\cli-truncate\index.js
require() of ES modules is not supported.
require() of D:\workspace\my-app\node_modules\cli-truncate\index.js from D:\workspace\my-app\packages\website\.next\server\pages\blog.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 index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from D:\workspace\my-app\node_modules\cli-truncate\package.json.
Do you have any idea why is this happening?
The text was updated successfully, but these errors were encountered:
Hello,
I just installed this package, which by the way, seems to be the only one that does truncation and is currently maintained.
However, I have an issue while using this package inside my Next.Js application (in Typescript).
Here is how I import the package :
And here is the error on runtime:
Do you have any idea why is this happening?
The text was updated successfully, but these errors were encountered: