Using lerna, babel cannot resolve packages
See original GitHub issueDescribe the bug
Module parse failed: Unexpected token (42:24)
File was processed with these loaders:
* ./node_modules/@storybook/source-loader/dist/server/index.js
You may need an additional loader to handle the result of these loaders.
|
| storiesOf("Task", module).addParameters({ storySource: { source: __STORY__, locationsMap: __ADDS_MAP__ } }).addDecorator(withSourceLoader(__STORY__, __ADDS_MAP__,__MAIN_FILE_LOCATION__,__MODULE_DEPENDENCIES__,__LOCAL_DEPENDENCIES__,__SOURCE_PREFIX__,__IDS_TO_FRAMEWORKS__))
> .add("default", () => <Task task={task} {...actions} />)
| .add("pinned", () => (
| <Task task={{ ...task, state: "TASK_PINNED" }} {...actions} />
Error: Module parse failed: Unexpected token (42:24)
File was processed with these loaders:
* ./node_modules/@storybook/source-loader/dist/server/index.js
You may need an additional loader to handle the result of these loaders.
|
| storiesOf("Task", module).addParameters({ storySource: { source: __STORY__, locationsMap: __ADDS_MAP__ } }).addDecorator(withSourceLoader(__STORY__, __ADDS_MAP__,__MAIN_FILE_LOCATION__,__MODULE_DEPENDENCIES__,__LOCAL_DEPENDENCIES__,__SOURCE_PREFIX__,__IDS_TO_FRAMEWORKS__))
> .add("default", () => <Task task={task} {...actions} />)
| .add("pinned", () => (
| <Task task={{ ...task, state: "TASK_PINNED" }} {...actions} />
at Object../packages/common/src/Task.stories.js (http://localhost:9009/main.e20d7b02cd69e0990a98.bundle.js:100:7)
at __webpack_require__ (http://localhost:9009/runtime~main.e20d7b02cd69e0990a98.bundle.js:785:30)
at fn (http://localhost:9009/runtime~main.e20d7b02cd69e0990a98.bundle.js:151:20)
at webpackContext (http://localhost:9009/main.e20d7b02cd69e0990a98.bundle.js:74:9)
at http://localhost:9009/vendors~main.e20d7b02cd69e0990a98.bundle.js:26595:29
at Array.forEach (<anonymous>)
at http://localhost:9009/vendors~main.e20d7b02cd69e0990a98.bundle.js:26594:20
at Array.forEach (<anonymous>)
at http://localhost:9009/vendors~main.e20d7b02cd69e0990a98.bundle.js:26593:12
at ConfigApi.configure (http://localhost:9009/vendors~main.e20d7b02cd69e0990a98.bundle.js:23463:7)
Code snippets
module.exports = {
stories: ["../packages/**/*.stories.(js|mdx)"],
addons: [
"@storybook/addon-actions",
"@storybook/addon-links",
"@storybook/preset-create-react-app",
{
name: "@storybook/addon-docs",
options: {
configureJSX: true
}
}
]
};
System:
npx -p @storybook/cli@next sb init -p babel ts tsx --story-format mdx
Additional context
@storybook 6.0.0-alpha.31
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:18 (4 by maintainers)
Top Results From Across the Web
node.js - lerna + webpack + babel-loader issue - Stack Overflow
One nice thing about using Lerna is you can pull devDependencies up to the repo root to factor them out of the individual...
Read more >Managing Monorepo using Lerna and Yarn workspaces
In this article, what we call "Monorepo" is a way to manage multiple npm packages in a single repository. Babel, Jest, and Create...
Read more >Creating Monorepo using Lerna - Medium
Note — This Blog explains the monorepo creation from scratch using Lerna and focuses on some of the basic issues you can face...
Read more >Can't add local package in a monorepo lerna project - Support
I have a monorepo that uses yarn workspaces + lerna. In my “frontend” package, I want to add the “tsdx-test” which is another...
Read more >Managing Your Typescript Monorepo With Lerna and Codefresh
Additionally, you cannot necessarily use the same tools and processes ... This will create a Lerna configuration file and a package folder, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any suggestion yet on a solution or workaround @astrotim ?
Keeping this issue alive as I’m still hoping for a solution to be found.