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

Compiling manager fails to: comment file "xxx.worker.js.LICENSE.txt" conflicts with an existing asset #11668

Closed
aivenkimmob opened this issue Jul 23, 2020 · 11 comments

Comments

@aivenkimmob
Copy link

Describe the bug

When running build-storybook -c .storybook -o storybook-static, the build fails to "Compiling manager" step. This only happened with the recent 6.0.0-rc.X versions. I tried with rc 1, 10, 11, and 14. All failed to the same step

The current workaround is to use 6.0.0-beta.20. I checked what version you use in Storybook design system: https://github.com/storybookjs/design-system/blob/master/package.json and copied the same.

To Reproduce
Steps to reproduce the behavior:

Run build-storybook -c .storybook -o storybook-static with new versions of major 6. Console will output this error:

12:25:47 PM: info => Compiling manager..
12:26:25 PM: ERR! => Failed to build the manager
12:26:25 PM: ERR! The comment file "1cd777c4fb4f5c3aa725.worker.js.LICENSE.txt" conflicts with an existing asset, this may lead to code corruption, please use a different name
12:26:25 PM: (node:1637) UnhandledPromiseRejectionWarning: [object Object]
12:26:25 PM: (node:1637) 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(). (rejection id: 1)
12:26:25 PM: (node:1637) [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.

Expected behavior

I would expect the build to succeed.

Code snippets
Our .storybook/main.js:

module.exports = {
  stories: ['../src/**/*.stories.@(ts|tsx|js|jsx|mdx)'],
  addons: [
    '@storybook/addon-knobs/register',
    'storybook-addon-designs/register',
    '@storybook/addon-actions',
    '@storybook/addon-links',
    {
      name: '@storybook/addon-docs',
      options: {
        configureJSX: true,
        babelOptions: {},
        sourceLoaderOptions: null,
      },
    },
  ],
};

System:

Environment Info:

  System:
    OS: Linux 5.7 Fedora 32 (Workstation Edition) 32 (Workstation Edition)
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
  Binaries:
    Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node
    npm: 6.14.4 - ~/.nvm/versions/node/v12.18.0/bin/npm
  Browsers:
    Chrome: 84.0.4147.89
    Firefox: 78.0.2
  npmPackages:
    @storybook/addon-actions: 6.0.0-rc.14 => 6.0.0-rc.14 
    @storybook/addon-docs: 6.0.0-rc.14 => 6.0.0-rc.14 
    @storybook/addon-knobs: 6.0.0-rc.14 => 6.0.0-rc.14 
    @storybook/addon-links: 6.0.0-rc.14 => 6.0.0-rc.14 
    @storybook/addons: 6.0.0-rc.14 => 6.0.0-rc.14 
    @storybook/preset-typescript: ^3.0.0 => 3.0.0 
    @storybook/react: 6.0.0-rc.14 => 6.0.0-rc.14 

Additional context

Some similar issues I found:

@shilman
Copy link
Member

shilman commented Jul 23, 2020

Do you have a repro we can look at?

@aivenkimmob
Copy link
Author

Not yet, I was thinking it might be an already known issue. I'll try to come up with a reporoducable repo.

@aivenkimmob
Copy link
Author

@shilman
Copy link
Member

shilman commented Jul 23, 2020

I removed storybook-addon-designs and the error went away. @pocka can you help here?

@pocka
Copy link
Contributor

pocka commented Jul 24, 2020

Probably webpack-contrib/worker-loader#260.

The addon depends on react-pdf (I know I should have put the dependency into peerDependencies), which uses Worker script imported via worker-loader. Since I'm not sure which package depends on worker-loader, a temporary workaround until a fix comes to the loader is pinning terser-webpack-plugin to v3.0.6.

with Yarn workspace
// package.json
{
  // ...
  "resolutions": {
    "terser-webpack-plugin": "3.0.6"
  }
}
with npm
$ npm i -D terser-webpack-plugin@3.0.6

If none of the above workarounds works, please tell me.

@aivenkimmob
Copy link
Author

I'll be away for a few weeks and get back to it unless someone from our team looks into it. Thanks for the help already.

@stale
Copy link

stale bot commented Aug 16, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Aug 16, 2020
@aivenkimmob
Copy link
Author

Adding a few investigation links:

I didn't have yet time to test if this issue was gone but looks like there are new updates to package.jsons in the dependencies

@stale stale bot removed the inactive label Aug 31, 2020
@stale
Copy link

stale bot commented Oct 4, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale
Copy link

stale bot commented Dec 26, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Dec 26, 2020
@pocka
Copy link
Contributor

pocka commented May 21, 2021

The bug was fixed in upstream (webpack-contrib/terser-webpack-plugin#279), closing.

@pocka pocka closed this as completed May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants