Open
Description
Some relevant dependencies used:
"@types/ts-nameof": "^4.2.1",
"ts-loader": "^9.2.3",
"ts-nameof": "^5.0.0",
"typescript": "^4.3.2",
"webpack": "^5.41.1",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^3.11.2",
Relevant parts of webpack-config:
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
getCustomTransformers: () => ({ before: [tsNameof] }),
},
},
],
},
],
},
I get the following error at runtime:
Uncaught ReferenceError: nameof is not defined
at eval (webpack-internal:///./src/components/Pages/Pages.tsx:36)
at Object../src/components/Pages/Pages.tsx (bundle.min.app.f52422b76f41c59b99cb.js:15146)
at __webpack_require__ (bundle.min.app.f52422b76f41c59b99cb.js:23364)
...
As it turns out, the line in bundle.min.app.f52422b76f41c59b99cb.js mentioned in the error contains calls to the function nameof
which is indeed not defined anywhere. This seems to happen since Typescript 4.3, at least in my setup: Looking at the minified bundle using the older TS-version 4.2.4, I cannot find such a call, hence everything works fine.
Any help is appreciated! 🙏🏻
Metadata
Metadata
Assignees
Labels
No labels