Giter Club home page Giter Club logo

Comments (10)

wickstargazer avatar wickstargazer commented on July 18, 2024 1

Hey guys,

I tried migrating to nx-13 and got stuck and webpack typings used to build and dependency tree shaking

Would you guys have time to chip in?

We have a slack channel we can discuss and go thru it together

from nx-plugins.

wickstargazer avatar wickstargazer commented on July 18, 2024 1

now i am stuck here, while building the webpack. Anyone can help?

(node:20636) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:20636) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
    at D:\projects\flowaccount\nx-plugins\node_modules\copy-webpack-plugin\dist\index.js:483:23
    at fn (D:\projects\flowaccount\nx-plugins\node_modules\webpack\lib\Compilation.js:507:9)
    at Hook.eval [as callAsync] (eval at create (D:\projects\flowaccount\nx-plugins\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:10:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (D:\projects\flowaccount\nx-plugins\node_modules\tapable\lib\Hook.js:18:14)
    at cont (D:\projects\flowaccount\nx-plugins\node_modules\webpack\lib\Compilation.js:3052:34)
    at D:\projects\flowaccount\nx-plugins\node_modules\webpack\lib\Compilation.js:3100:10
    at symbolIterator (D:\projects\flowaccount\nx-plugins\node_modules\neo-async\async.js:3485:9)
    at done (D:\projects\flowaccount\nx-plugins\node_modules\neo-async\async.js:3527:9)
    at D:\projects\flowaccount\nx-plugins\node_modules\neo-async\async.js:2830:7
    at done (D:\projects\flowaccount\nx-plugins\node_modules\neo-async\async.js:2865:11)
    at D:\projects\flowaccount\nx-plugins\node_modules\neo-async\async.js:2818:7
    at D:\projects\flowaccount\nx-plugins\node_modules\webpack\lib\Compilation.js:4621:18
    at D:\projects\flowaccount\nx-plugins\node_modules\webpack\lib\HookWebpackError.js:68:3
    at Hook.eval [as callAsync] (eval at create (D:\projects\flowaccount\nx-plugins\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
    at Cache.store (D:\projects\flowaccount\nx-plugins\node_modules\webpack\lib\Cache.js:107:20)
    at ItemCacheFacade.store (D:\projects\flowaccount\nx-plugins\node_modules\webpack\lib\CacheFacade.js:137:15)
(node:20636) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:20636) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

from nx-plugins.

SquareLi avatar SquareLi commented on July 18, 2024

Sure, how can I join the channel?

from nx-plugins.

wickstargazer avatar wickstargazer commented on July 18, 2024

Use the link here

https://join.slack.com/t/flowaccountcommunity/shared_invite/zt-10dw6janp-JVE7k6y7OXf8ET9t2Y2BKQ

from nx-plugins.

wickstargazer avatar wickstargazer commented on July 18, 2024

the migrated workspace is in migrate/nx-13 branch

the error is

libs/nx-serverless/src/utils/depcheck.ts:42:20 - error TS2702: 'Stats' only refers to a type, but is being used as a namespace here.

42     webpackStats?: Stats.ToJsonOutput,
                      ~~~~~
libs/nx-serverless/src/utils/node.config.ts:27:7 - error TS2322: Type '(context: any, request: any, callback: Function) => any' is not assignable to type 'ExternalItem'.
  Type '(context: any, request: any, callback: Function) => any' is not assignable to type '(data: ExternalItemFunctionData, callback: (err?: Error, result?: string | boolean | string[] | { [index: string]: any; }) => void) => void'.

27       function (context, request, callback: Function) {
         ~~~~~~~~
libs/nx-serverless/src/utils/node.config.ts:42:10 - error TS2349: This expression is not callable.
  Type 'typeof import("D:/projects/flowaccount/nx-plugins/node_modules/webpack-merge/dist/index")' has no call signatures.

42   return mergeWebpack(getBaseWebpackPartial(options), getNodePartial(options));
            ~~~~~~~~~~~~
libs/nx-serverless/src/utils/packagers/index.ts:39:10 - error TS2724: '"webpack"' has no exported member named 'compilation'. Did you mean 'Compilation'?

39 import { compilation, Stats } from 'webpack';
            ~~~~~~~~~~~
libs/nx-serverless/src/utils/packagers/index.ts:67:10 - error TS2702: 'Stats' only refers to a type, but is being used as a namespace here.

67   stats: Stats.ToJsonOutput,
            ~~~~~
libs/nx-serverless/src/utils/types.ts:82:18 - error TS2702: 'Stats' only refers to a type, but is being used as a namespace here.

82   webpackStats?: Stats.ToJsonOutput,
                    ~~~~~
libs/nx-serverless/src/utils/webpack.stats.ts:16:20 - error TS2702: 'Stats' only refers to a type, but is being used as a namespace here.

16     webpackStats?: Stats.ToJsonOutput,
                      ~~~~~
libs/nx-serverless/src/utils/webpack.stats.ts:58:29 - error TS2702: 'Stats' only refers to a type, but is being used as a namespace here.

58   getExternalModules(stats: Stats.ToJsonOutput) {
                               ~~~~~

libs/nx-serverless/src/utils/depcheck.ts:42:20 - error TS2702: 'Stats' only refers to a type, but is being used as a namespace here.

42     webpackStats?: Stats.ToJsonOutput,
                      ~~~~~
libs/nx-serverless/src/utils/node.config.ts:27:7 - error TS2322: Type '(context: any, request: any, callback: Function) => any' is not assignable to type 'ExternalItem'.
  Type '(context: any, request: any, callback: Function) => any' is not assignable to type '(data: ExternalItemFunctionData, callback: (err?: Error, result?: string | boolean | string[] | { [index: string]: any; }) => void) => void'.

27       function (context, request, callback: Function) {
         ~~~~~~~~
libs/nx-serverless/src/utils/node.config.ts:42:10 - error TS2349: This expression is not callable.
  Type 'typeof import("D:/projects/flowaccount/nx-plugins/node_modules/webpack-merge/dist/index")' has no call signatures.

42   return mergeWebpack(getBaseWebpackPartial(options), getNodePartial(options));
            ~~~~~~~~~~~~
libs/nx-serverless/src/utils/packagers/index.ts:39:10 - error TS2724: '"webpack"' has no exported member named 'compilation'. Did you mean 'Compilation'?

39 import { compilation, Stats } from 'webpack';
            ~~~~~~~~~~~
libs/nx-serverless/src/utils/packagers/index.ts:67:10 - error TS2702: 'Stats' only refers to a type, but is being used as a namespace here.

67   stats: Stats.ToJsonOutput,
            ~~~~~
libs/nx-serverless/src/utils/types.ts:82:18 - error TS2702: 'Stats' only refers to a type, but is being used as a namespace here.

82   webpackStats?: Stats.ToJsonOutput,
                    ~~~~~
libs/nx-serverless/src/utils/webpack.stats.ts:16:20 - error TS2702: 'Stats' only refers to a type, but is being used as a namespace here.

16     webpackStats?: Stats.ToJsonOutput,
                      ~~~~~
libs/nx-serverless/src/utils/webpack.stats.ts:58:29 - error TS2702: 'Stats' only refers to a type, but is being used as a namespace here.

58   getExternalModules(stats: Stats.ToJsonOutput) {
                               ~~~~~

error Command failed with exit code 1.

from nx-plugins.

tstackhouse avatar tstackhouse commented on July 18, 2024

That looks like it could be related to changes in webpack 5’s exports. I’ve not touched it yet, I may be able to dig around tomorrow, but at least in my usage I’m still not on the latest version of anything yet.

from nx-plugins.

SquareLi avatar SquareLi commented on July 18, 2024

sorry i was out for a few days. Is the invite already expired? I'm not able to find any workspace with my github email.

from nx-plugins.

wickstargazer avatar wickstargazer commented on July 18, 2024

https://join.slack.com/t/flowaccountcommunity/shared_invite/zt-125cti9bb-KupsvzTn3G4KdOZ43qBWiA

Never expires now

from nx-plugins.

wickstargazer avatar wickstargazer commented on July 18, 2024

branch migrate/nx-13 is building now. need to test and make sure no effects to

  • packager from stats-compilation object
  • depcheck

from nx-plugins.

wickstargazer avatar wickstargazer commented on July 18, 2024

we need to migrate https://github.com/flowaccount/nx-plugins/blob/migrate/nx-13/libs/nx-serverless/src/builders/build/build.impl.ts which is using https://github.com/flowaccount/nx-plugins/blob/migrate/nx-13/libs/nx-serverless/src/utils/run-webpack.ts to use https://github.com/nrwl/nx/blob/master/packages/node/src/executors/webpack/webpack.impl.ts

from nx-plugins.

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.