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]: CSF Parsing error: Expected 'ObjectExpression' but found 'undefined' instead in 'Identifier' #29567

Open
unional opened this issue Nov 7, 2024 · 0 comments

Comments

@unional
Copy link
Contributor

unional commented Nov 7, 2024

Describe the bug

Full message:

CSF Parsing error: Expected 'ObjectExpression' but found 'undefined' instead in 'Identifier'.
{"type":"Identifier","start":70,"end":76,"loc":null,"name":"config"}

This is because in my .storybook/main.ts, I have:

import { config } from 'my-config'

export default config

When I change it to:

export { config as default } from 'my-config'

It is working.

I think the parser should accept that AST

Reproduction link

https://stackblitz.com/edit/github-pukf1b?file=.storybook%2Fmain.js

Reproduction steps

Not sure if the link repro the same issue. Can create a separate repro if needed

System

Storybook Environment Info:

System:
OS: macOS 14.7
CPU: (10) arm64 Apple M1 Pro
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.9.0 - ~/.local/state/fnm_multishells/38402_1731010456579/bin/node
npm: 10.8.3 - ~/.local/state/fnm_multishells/38402_1731010456579/bin/npm
pnpm: 9.12.1 - ~/.nvm/versions/node/v20.12.2/bin/pnpm <----- active
Browsers:
Chrome: 130.0.6723.116
Safari: 18.0

Additional context

Talked about it here:
https://discord.com/channels/486522875931656193/1304141030672826389/1304175681411747954

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants