Git Product home page Git Product logo

Comments (11)

dan-cooke avatar dan-cooke commented on June 12, 2024 2

@SirPhemmiey i cannot provide the repo as it’s private.

But I had previously experienced this error message because I was not setting the webpack plugins outputPath in my project json

I can give you an example of a working config later

from nx.

SirPhemmiey avatar SirPhemmiey commented on June 12, 2024 1

@dan-cooke can you provide the github project for us to compare? and what do you mean by "setting out path correctly">

from nx.

martialanouman avatar martialanouman commented on June 12, 2024

Hi,
Any update on this ?

from nx.

SirPhemmiey avatar SirPhemmiey commented on June 12, 2024

Hello, any update on this, please?

from nx.

dan-cooke avatar dan-cooke commented on June 12, 2024

I cannot reproduce this, I am using generate package successfully in my project. Check you guys are setting out path correctly

from nx.

SirPhemmiey avatar SirPhemmiey commented on June 12, 2024

@dan-cooke i would highly appreciate it, thank you.

from nx.

martialanouman avatar martialanouman commented on June 12, 2024

Hi @dan-cooke , could you provide the configuration example you mentioned in your last comment?

from nx.

dan-cooke avatar dan-cooke commented on June 12, 2024
{
  "name": "api",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/api/src",
  "projectType": "application",
  "targets": {
    "build": {
      "executor": "@nx/webpack:webpack",
      "options": {
        "webpackConfig": "apps/api/webpack.config.js",
        "outputPath": "dist/apps/api"
      }
    }
}
const { NxWebpackPlugin } = require('@nx/webpack');
const { join } = require('path');

module.exports = {
  output: {
    path: join(__dirname, '../../dist/apps/api'),
  },
  plugins: [
    new NxWebpackPlugin({
      target: 'node',
      compiler: 'tsc',
      main: './src/main.ts',
      tsConfig: './tsconfig.app.json',
      generatePackageJson: true,
      transformers: [
        {
          name: '@nestjs/swagger/plugin',
          options: {
            introspectComments: true,
          },
        },
      ],
      assets: ['./src/assets'],
      optimization: false,
      outputHashing: 'none',
    }),
  ],
};

Works for me

I can post a min repro someday soon, but have you made sure you are not running with the nx cache? I always run my builds with --skipNxCache because i've found it to be stale most of the time

Edit: Just realised im missing outputPath, I added that in and it still works

Node   : 20.9.0
OS     : linux-x64
yarn   : 1.22.22

nx (global)        : 18.0.8
nx                 : 18.0.6
@nx/js             : 18.0.6
@nx/jest           : 18.0.6
@nx/linter         : 18.0.6
@nx/eslint         : 18.0.6
@nx/workspace      : 18.0.6
@nx/cypress        : 18.0.6
@nx/devkit         : 18.0.6
@nx/esbuild        : 18.0.6
@nx/eslint-plugin  : 18.0.6
@nx/nest           : 18.0.6
@nx/node           : 18.0.6
@nx/react          : 18.0.6
@nrwl/tao          : 18.0.6
@nx/vite           : 18.0.6
@nx/web            : 18.0.6
@nx/webpack        : 18.0.6
typescript         : 5.3.3
---------------------------------------
Community plugins:
@nx-extend/shadcn-ui : 1.0.0

from nx.

martialanouman avatar martialanouman commented on June 12, 2024

Hi @dan-cooke,
Thanks. Testing it...

from nx.

pmwisdom avatar pmwisdom commented on June 12, 2024

I'm not sure if this helps but I ran into this issue with an application that was using TSC that was importing a SWC library with a custom executor I wrote to generate the application's package json since it couldn't use esbuild or webpack.

My executor looked like this

   // The call to getHelperDependenciesFromProjectGraph was failing
    const helperDependencies = getHelperDependenciesFromProjectGraph(
        context.root,
        context.projectName!,
        context.projectGraph!
    );

    const packageJson = createPackageJson(context.projectName!, context.projectGraph!, {
        target: context.targetName,
        root: context.root,
        isProduction: true,
        helperDependencies: helperDependencies.map((dep) => dep.target),
    });

Removing the function call getHelperDependenciesFromProjectGraph and passing in an empty array for helperDependencies alleviated the issue for that application

from nx.

Coly010 avatar Coly010 commented on June 12, 2024

This issue has been resolved and therefore I'm going to close it.

Thanks everyone for weighing in!

from nx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.