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 use import.meta.url in nuxt.config.js and in another ES module that is referenced from nuxt.config.js. That other module is also called by Node.js directly, so I can't just use __filename or __dirname instead.
I suggest transpiling import.meta.url to 'file://' + __filename in Jiti to support this case.
The text was updated successfully, but these errors were encountered:
pi0
changed the title
Cannot use 'import.meta' outside a module
transpile import.meta.url
Feb 18, 2021
Hi. jiti@1.6.0 supports import.meta.url now. Best way to update for nuxt is recreating yarn.lock/package.lock.json file
@linqFR You can set createRequire inside nuxt.config to native if for any reason but i don't recommand that. Please report any other issues encountered to nuxt repository so we can address :)
I have set
"type": "module"
inpackage.json
.I use
import.meta.url
innuxt.config.js
and in another ES module that is referenced fromnuxt.config.js
. That other module is also called by Node.js directly, so I can't just use__filename
or__dirname
instead.I suggest transpiling
import.meta.url
to'file://' + __filename
in Jiti to support this case.The text was updated successfully, but these errors were encountered: