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

assetsDir broken in 11.0.9 with create-react-app #1676

Closed
stufisher opened this issue Sep 3, 2020 · 6 comments · Fixed by #1690
Closed

assetsDir broken in 11.0.9 with create-react-app #1676

stufisher opened this issue Sep 3, 2020 · 6 comments · Fixed by #1690

Comments

@stufisher
Copy link

Current behavior

After updating to 11.0.9 it is no longer possible to build the styleguide if using assetsDir (which invokes the webpack copy plugin)

To reproduce

styleguideist build

Building style guide...
ValidationError: Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
 - options[0] misses the property 'patterns'. Should be:
   [non-empty string | object { from, to?, context?, globOptions?, filter?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
ValidationError: Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
 - options[0] misses the property 'patterns'. Should be:
   [non-empty string | object { from, to?, context?, globOptions?, filter?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
    at validate (.../node_modules/react-styleguidist/node_modules/schema-utils/dist/validate.js:98:11)
    at new CopyPlugin (.../node_modules/react-styleguidist/node_modules/copy-webpack-plugin/dist/index.js:32:30)
    at _default (.../node_modules/react-styleguidist/lib/scripts/make-webpack-config.js:114:34)
    at build (.../node_modules/react-styleguidist/lib/scripts/build.js:13:63)
    at commandBuild (.../node_modules/react-styleguidist/lib/bin/styleguidist.js:105:20)
    at Object.<anonymous> (.../node_modules/react-styleguidist/lib/bin/styleguidist.js:71:5)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

If i remove
assetsDir: 'src/assets/images/',

Then all builds as normal. I noticed webpack copy plugin has been updated to 6.0.x, downgrading this alone to 5.x.x does not fix the issue.

Downgrading styleguidist to 11.0.8 does allow the styleguide to build.

Expected behavior

Styleguide should build

@sapegin
Copy link
Member

sapegin commented Sep 3, 2020

That's weird that downgrading back doesn't help. Is it possible that it's still cached and you still have the new version?

Mind checking changelog to see if we need to upgrade any configuration? A pull request would be awesome 👾

@lefreet
Copy link

lefreet commented Sep 8, 2020

@sapegin it's a broken update in copy-webpack-plugin, but not update with make-webpack-config, from 11.08 to 11.09

@lefreet
Copy link

lefreet commented Sep 8, 2020

see with 53bc4bb

@swashata
Copy link
Contributor

swashata commented Sep 8, 2020

I would like to take a crack at this, if anyone else is not already working.

@swashata
Copy link
Contributor

swashata commented Sep 8, 2020

Pull Request #1690 is ready. I have also tested it with linking to my local project and it works fine. @sapegin kindly review at your convenience.

sapegin pushed a commit that referenced this issue Sep 8, 2020
Because copy-webpack-pluign was updated, the assetsDir was broken.
We need to update the config being passed to the plugin to make it
work again. Update the plugin to latest version 6.1.0 and update
the config and tests to make it work.

Fixes #1676
@styleguidist-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 11.0.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants