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

DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET warning #704

Closed
skaneprime opened this issue Apr 29, 2021 · 6 comments · Fixed by #705 or #710
Closed

DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET warning #704

skaneprime opened this issue Apr 29, 2021 · 6 comments · Fixed by #705 or #710
Labels
bug Something isn't working

Comments

@skaneprime
Copy link

skaneprime commented Apr 29, 2021

When I use ncc build it throws me this warnings

(node:13680) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method 'reduce' is deprecated)
(Use 'discord-basebot-core --trace-deprecation ...' to show where the warning was created)        
(node:13680) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)

How to disable this warning?

@styfle
Copy link
Member

styfle commented Apr 29, 2021

Which version of ncc are you using and can you provide the code you're trying to compile?

@skaneprime
Copy link
Author

skaneprime commented Apr 30, 2021

Which version of ncc are you using and can you provide the code you're trying to compile?

Version is 0.28.3

the code

export default () => {}

I'm trying to programmatically compile it like this

const { code }: { code: string } = await ncc( path.join(process.cwd(), entryFiles[0]), {
            minify: true,
            quiet: true
        })

@skaneprime
Copy link
Author

The issue didn't resolved :( How to deal with this? (How to ignore or handle maybe?)

(node:18244) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method 'reduce' is deprecated)
(Use `basebot --trace-deprecation ...` to show where the warning was created)
(node:18244) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
(node:18244) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
        Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
        Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.

image

const ncc = await require('@vercel/ncc')(`${process.cwd()}/${tsFilePath}`, {
        quiet: true
    })

@styfle styfle reopened this May 10, 2021
@styfle styfle added the bug Something isn't working label May 10, 2021
@styfle styfle changed the title How to disable (ignore) WEBPACK DEPRECATION error? DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET warning May 10, 2021
@styfle
Copy link
Member

styfle commented May 10, 2021

Looks like the warning is coming from ts-loader

$ node --trace-deprecation build.js
ncc: Version 0.28.5
ncc: Compiling file index.js
ncc: Using typescript@4.2.4 (local user-provided)
(node:19593) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method 'reduce' is deprecated)
    at Set.e.<computed> [as reduce] (node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:37:1208051)
    at determineModules (node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache.js:19:67131)
    at /Users/styfle/Code/foo/ncc-warn/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache.js:19:66412
    at Hook.eval [as callAsync] (eval at create (node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:20:117070), <anonymous>:16:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:20:114232)
    at node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:37:179174
    at node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:37:145418
    at Hook.eval [as callAsync] (eval at create (node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:20:117070), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:20:114232)
    at node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:37:145316
(node:19593) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
    at node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache.js:19:68317
    at Array.forEach (<anonymous>)
    at provideErrorsToWebpack (node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache.js:19:68281)
    at node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache.js:19:66500
// ...truncated... //

@skaneprime
Copy link
Author

@styfle No ideas how to solve this warning?

@styfle
Copy link
Member

styfle commented May 21, 2021

I haven't looked into it any further, but feel free to submit a PR if you have a solution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants