-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Duplicate plugin/preset detected #91
Comments
Hi @coffeedoughnuts, thanks for the feedback! module.exports = {
typescript: true,
- plugins: [],
debug: true
} |
Hey @marceloavf That was leftover from my debugging attempts - removing it provides the same error in output |
@coffeedoughnuts You're using the same default plugins that docz uses internal... some workaround that you can do is that: // doczrc.js
export default {
modifyBabelRc: (babelrc) => {
babel.babelrc = true
babel.presets = []
return babelrc
}
} |
Thanks for the help @pedronauck That seems to unblock my issue, though creates a new one:
module.exports = {
typescript: true,
modifyBabelRc: (babelrc) => {
babelrc.babelrc = true
babelrc.presets = []
return babelrc
}
}
component-lib · yarn docz build
yarn run v1.7.0
$ /Users/danbaker/Repos/new/component-lib/node_modules/.bin/docz build
▶ start Creating an optimized production build...
✖ fatal Failed to compile.
./.docz/app/imports.js
Module build failed (from ./node_modules/happypack/loader.js):
SyntaxError: /Users/danbaker/Repos/new/component-lib/.docz/app/imports.js: Support for the experimental syntax 'dynamicImport' isn't currently enabled (3:5):
1 | export const imports = {
2 | 'src/Button/README.mdx': () =>
> 3 | import(/* webpackPrefetch: true, webpackChunkName: "src-button-readme" */ 'src/Button/README.mdx'),
| ^
4 | }
5 |
Add @babel/plugin-syntax-dynamic-import (https://git.io/vb4Sv) to the 'plugins' section of your Babel config to enable parsing.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. am I right in assuming that this needs me to install |
working on that assumption, I modified my module.exports = {
typescript: true,
modifyBabelRc: (babelrc) => {
babelrc.babelrc = true
babelrc.presets = []
babelrc.plugins = ['@babel/plugin-syntax-dynamic-import']
return babelrc
}
} and the output was: component-lib · yarn docz build
yarn run v1.7.0
$ /Users/danbaker/Repos/new/component-lib/node_modules/.bin/docz build
▶ start Creating an optimized production build...
✖ fatal Failed to compile.
./src/Button/index.tsx
Module build failed (from ./node_modules/happypack/loader.js):
SyntaxError: /Users/danbaker/Repos/new/component-lib/src/Button/index.tsx: Unexpected token, expected ";" (11:1)
9 | export default ({ children }: ButtonProps) => (
10 | <button className={style.Button}>{children}</button>
> 11 | )try {
| ^
12 | // @ts-ignore
13 | Button.displayName = "Button";
14 | // @ts-ignore
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. |
@coffeedoughnuts I was having the same problem as you, but this last attempt suited me... thanks
module.exports = {
typescript: true,
modifyBabelRc: (babelrc) => {
babelrc.babelrc = true
babelrc.presets = []
babelrc.plugins = ['@babel/plugin-syntax-dynamic-import']
return babelrc
}
} |
Fixed on previous release v0.9.2 |
I'm using export default {
modifyBabelRc: (babelrc) => ({
...babelrc,
babelrc: true,
}),
}; |
Recently I have installed module.exports = {
modifyBabelRc: babelrc => Object.assign({}, babelrc, { plugins: [] }),
} |
Hi all, I have started a new and mostly empty project, with a pretty simple {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"react-hot-loader/babel"
]
} After the first error ( export default {
modifyBabelRc: (babelrc) => {
return Object.assign({}, babelrc, { plugins: [
'@babel/plugin-syntax-dynamic-import'
]
});
}; And finally, I have a new error: Don't know what to do next. Any clue? I'm working with Thanks in advance. |
Even more, I have tried the Getting Started over an empty project with just the npm init -y
npm i -D docz docz-theme-default
npm run docz:dev |
@timbergus see #596 |
Thanks a lot, @kserjey. I have tried with Yarn instead of NPM and it works. Apologies for the inconveniences. |
Same error even with yarn.
package.json |
Installing from yarn is not a solid solution |
Bug Report
I cannot build my project
Building complains of duplicate plugins - either it's a bug or I have configured it wrong after following documentation.
To Reproduce
This is my basic setup:
src/Button/index.tsx
src/Button/README.mdx
doczrc.js
.babelrc
webpack.config.js
package.json
output
Expected behavior
Build
Enviroment
The text was updated successfully, but these errors were encountered: