Skip to content

webpack 2 with parser rules requireEnsure breaks react-styleguidist #463

@oieduardorabelo

Description

@oieduardorabelo

Hi guys!

I searched in the issues with these keywords: require, ensure, require.ensure, and nothing related to my problem came in the result.

I already fixed it, but, I did a bit of googling, and there's no issues/topics with that, so, my intention here is to share my findings. For someone searching about it, or facing the same problem.

My problem

I was working in a project and implementing react-styleguidist, when I tried to run it, this was the error:

screen shot 2017-06-01 at 5 16 31 pm

Not that helpful, right?! My styleguide.config.js:

module.exports = {
  components: 'client/presentation/**/*.jsx',
};

Pretty simple, so, what is happening?

Deep down in the webpack config chain (you know merge, merge, import and merge hahaha), and stuck in the base configuration, I found this declaration in the webpack config:

screen shot 2017-06-01 at 5 20 20 pm

Since react-styleguidist relies in the webpack syntax for require.ensure, looking in the documentation for the Rule.parser, it shows this declaration just turn off that syntax, and no error message is defined/throw by react-styleguidist or even webpack to help with that.

Was just a few hours to find it, but, maybe someone else can run in the same problem.

Would be interesting the "check" the webpack config to see if this rule is there, and display a better message.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions