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

[Bug]: Fail when starting project. Error: It looks like you are having a known issue with package hoisting. #24318

Closed
VallisOctopus opened this issue Sep 27, 2023 · 1 comment

Comments

@VallisOctopus
Copy link

VallisOctopus commented Sep 27, 2023

Describe the bug

Error running Storybook

To fix this I normally have to remove the node_module folder and reinstall and then it works locally. However my Git actions fails with the below message.

yarn run v1.22.19
$ storybook build --output-dir /tmp/chromatic--1998-1coCAwPCf1iT
🔴 Error: It looks like you are having a known issue with package hoisting.
Please check the following issue for details and solutions: https://github.com/storybookjs/storybook/issues/22431#issuecomment-1630086092
/home/runner/work/deep-sea-components/deep-sea-components/node_modules/cli-table3/src/utils.js:1
const stringWidth = require('string-width');
                    ^
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/deep-sea-components/deep-sea-components/node_modules/string-width/index.js from /home/runner/work/deep-sea-components/deep-sea-components/node_modules/cli-table3/src/utils.js not supported.
Instead change the require of index.js in /home/runner/work/deep-sea-components/deep-sea-components/node_modules/cli-table3/src/utils.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/runner/work/deep-sea-components/deep-sea-components/node_modules/cli-table3/src/utils.js:1:21)
    at Object.<anonymous> (/home/runner/work/deep-sea-components/deep-sea-components/node_modules/cli-table3/src/table.js:2:15)
    at Object.<anonymous> (/home/runner/work/deep-sea-components/deep-sea-components/node_modules/cli-table3/index.js:1:18)
    at Object.<anonymous> (/home/runner/work/deep-sea-components/deep-sea-components/node_modules/@storybook/core-server/dist/index.js:101:8716)
    at Object.<anonymous> (/home/runner/work/deep-sea-components/deep-sea-components/node_modules/@storybook/cli/dist/generate.js:11:4[49](https://github.com/octopus-investments/deep-sea-components/actions/runs/6328180004/job/17185737636?pr=220#step:4:50)4)
    at Object.<anonymous> (/home/runner/work/deep-sea-components/deep-sea-components/node_modules/@storybook/cli/bin/index.js:26:1)
    at Object.<anonymous> (/home/runner/work/deep-sea-components/deep-sea-components/node_modules/storybook/index.js:3:1) {
  code: 'ERR_REQUIRE_ESM'
}
Node.js v18.18.0

To Reproduce

No response

System

No response

Additional context

No response

@VallisOctopus VallisOctopus changed the title [Bug]: [Bug]: Fail when starting project. Error: It looks like you are having a known issue with package hoisting. Sep 27, 2023
@pa-bouly
Copy link

pa-bouly commented Oct 10, 2023

Hi, i think it is a duplicate of 23493 and 22431. Please take a look at the following comment/workaround: #22431 (comment)

@vanessayuenn vanessayuenn closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants