-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use 'import.meta' outside a module on 0.36.0 (not 0.34.0) #1019
Comments
source: import { fileURLToPath } from "url"
fileURLToPath(`${import.meta.url}/../somestaticfile.txt`) compile with 0.34.0: import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
/******/
/************************************************************************/
var __webpack_exports__ = {};
;// CONCATENATED MODULE: external "url"
const external_url_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url");
;// CONCATENATED MODULE: ./src/index.js
(0,external_url_namespaceObject.fileURLToPath)(`${"file:///project/home/imyelo/workspace/src/index.js"}/../somestaticfile.txt`); compile with 0.36.0: import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
/******/
/************************************************************************/
var __webpack_exports__ = {};
;// CONCATENATED MODULE: external "url"
const external_url_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url");
;// CONCATENATED MODULE: ./src/index.js
(0,external_url_namespaceObject.fileURLToPath)(`${import.meta.url}/../somestaticfile.txt`); seems like webpack doesn't convert reproduces in https://codesandbox.io/p/sandbox/funny-rain-y4qvps |
Thanks for this! I had to downgrade all the way from 0.38 to make this work 🤷🏽♂️ |
I just ran into the same issue, and downgrading to |
Has there been a workaround found for this issue? I managed to pinpoint the problematic |
I just updated from version 0.34.0 to 0.36.0. In version 0.34.0 it works perfectly.
The text was updated successfully, but these errors were encountered: