Skip to content
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

@nrwl/webpack:webpack tsPlugins options removed in version 15 #12966

Closed
dan-cooke opened this issue Nov 3, 2022 · 6 comments
Closed

@nrwl/webpack:webpack tsPlugins options removed in version 15 #12966

dan-cooke opened this issue Nov 3, 2022 · 6 comments
Labels
outdated scope: bundlers Issues related to webpack, rollup type: bug

Comments

@dan-cooke
Copy link
Contributor

After running migrations from v14 to v15.

My webpack build target that uses tsPlugins fails

"targets": {
    "build": {
      "executor": "@nrwl/webpack:webpack",
      "dependsOn": [
        "type-util:build"
      ],
      "outputs": [
        "{options.outputPath}"
      ],
      "options": {
        "outputPath": "dist/apps/api",
        "main": "apps/api/src/main.ts",
        "generatePackageJson": true,
        "tsConfig": "apps/api/tsconfig.app.json",
        "tsPlugins": [
          {
            "name": "@nestjs/graphql/plugin",
            "options": {
              "introspectComments": true,
              "typeFileNameSuffix": [
                ".input.ts",
                ".args.ts",
                ".entity.ts",
                ".model.ts"
              ]
            }
          }
        ],
        "target": "node",
        "compiler": "tsc"
      },
@nartc
Copy link
Contributor

nartc commented Nov 3, 2022

Hi @dan-cooke, the tsPlugins has been renamed to transformers and we must have overlooked a migration for it. However, tsPlugins is still in the aliases array of transformers option so not sure how that stopped working for you.

For now, you can use transformers instead. https://github.com/nrwl/nx/blob/master/packages/webpack/src/executors/webpack/schema.json#L186

@dan-cooke
Copy link
Contributor Author

dan-cooke commented Nov 3, 2022

@nartc thank you! I was just about to downgrade to 14.x

However, tsPlugins is still in the aliases array of transformers option so not sure how that stopped working for you.

That is odd, is it potentially a nested property that is no longer supported in the transformers ?

"name": "@nestjs/graphql/plugin",
            "options": {
              "introspectComments": true,
              "typeFileNameSuffix": [
                ".input.ts",
                ".args.ts",
                ".entity.ts",
                ".model.ts"
              ]
            }

Because when I add this plugin via a custom webpack config to the ts-loader I get a similar "Invalid arguments" error.

Could be a difference with the new webpack version?

@nartc
Copy link
Contributor

nartc commented Nov 3, 2022

Oh if that's the case, please share with me a reproduce, I can try digging with you on that.

@dan-cooke
Copy link
Contributor Author

dan-cooke commented Nov 3, 2022

@nartc i haven’t got the time to create a repo at the moment, but it’s easily reproducible by bootstrapping a new NX NestJs workspace.

And copying my snippet from the original post.

you will get an error when using tsPlugins

@FrozenPandaz FrozenPandaz added the scope: bundlers Issues related to webpack, rollup label Nov 3, 2022
@jaysoo
Copy link
Member

jaysoo commented Feb 24, 2023

I couldn't reproduce the problem, but I was able to use the transformers option successfully. See here: https://github.com/jaysoo/issue-12966

Closing this issue but please re-open if you have a reproduction ready.

@jaysoo jaysoo closed this as completed Feb 24, 2023
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: bundlers Issues related to webpack, rollup type: bug
Projects
None yet
Development

No branches or pull requests

4 participants