Skip to content

Storybook breaks in newer versions of Node.js #2083

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

Open
leofarias-cpu opened this issue Feb 20, 2025 · 0 comments · May be fixed by #2100
Open

Storybook breaks in newer versions of Node.js #2083

leofarias-cpu opened this issue Feb 20, 2025 · 0 comments · May be fixed by #2100
Assignees
Labels
bug Something isn't working dev Indicates that the issue or pull request involves engineering considerations

Comments

@leofarias-cpu
Copy link
Collaborator

Problem

Trying to run pnpm dev:storybook with (at least) Node 23.7 or 23.8 results in an error because module is not defined. This seems to be related to the file using both CommonJS(module.exports , require) and ESM(import) features.

Expected behavior

No response

Reproducible Example

Download Node 23.8 and try to run pnpm dev:storybook

Suggested solution

Remove the ESM import at the top of the file and replace it the equivalent CommonJS syntax:

import { dirname, join } from 'node:path'
// turns into
const { dirname, join } = require('node:path')

I have tested this locally and it does resolve the problem. Changing the file to only use ESM might be better, but i couldn't quite do it.

Additional context

No response

Package

@vtex/shoreline

Packages version

No response

Browser

Chrome

Package Manager

pnpm

@leofarias-cpu leofarias-cpu added the bug Something isn't working label Feb 20, 2025
leofarias-cpu added a commit that referenced this issue Apr 3, 2025
… it to be run with node-23.8

main.js mixed Common JS and ESM syntax, which prevented pnpm dev:storybook from working in (at
least) node 23.7 and 23.8.

Storybook breaks in newer versions of Node.js #2083
@beatrizmilhomem beatrizmilhomem added the dev Indicates that the issue or pull request involves engineering considerations label Apr 30, 2025
@beatrizmilhomem beatrizmilhomem moved this to Active in Shoreline Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev Indicates that the issue or pull request involves engineering considerations
Projects
Status: Active
2 participants