@Args() and @Ctx() breaks build when using babel-loader #571
Labels
Community 👨👧
Something initiated by a community
Duplicate 🔑
This issue or pull request already exists
Question ❔
Not future request, proposal or bug issue
Describe the bug
Using @Args() and @ctx() being empty function seems to cause issues with babel-loader when I am using the suggested method in previous issues. I think this issue is a new one, thus opening a new issue.
which actually still doesn't completely work as I have to also use:
The issue seems to give the error:
The issue is the fact the @Args() is undefined since it has no typing it seems.
Here is my babel-loader
{ test: /\.(j|t)s$/i, use: [ { loader: "babel-loader", options: { cacheDirectory: true, presets: ["@babel/preset-typescript"], plugins: [ "babel-plugin-parameter-decorator", "babel-plugin-transform-typescript-metadata", ["@babel/plugin-proposal-decorators", { legacy: true }], ["@babel/plugin-proposal-class-properties", { loose: true }] ] } } ], }
tsconfig.json
{ "compilerOptions":{ "target":"es2019", "moduleResolution":"node", "resolveJsonModule":true, "module":"commonjs", "noEmit":true, "strict":true, "esModuleInterop":true, "emitDecoratorMetadata":true, "experimentalDecorators":true, "skipLibCheck":true, "jsx":"preserve", "baseUrl":".", "paths":{ "@/*":[ "src/*" ] } }, "include":[ "src", "run", "types" ] }
Is there something I am missing? Or something to get this to work as there seems to be others that say this works. For clarity if only using @arg(...), that works. I need @ctx() for passing user and db connection through... unless there is a better injection method for that?
Is there any work-around for this?
Environment (please complete the following information):
Additional context
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
"@babel/plugin-proposal-numeric-separator": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
This is being used in an SSR scenario, not sure that matters.
The text was updated successfully, but these errors were encountered: