Skip to content

After update, plugin not working w/ react-scripts | jQuery.Deferred exception: MyPlugin is not defined  #6407

Closed
@rfdc

Description

@rfdc

Is this a bug report?

Not Sure, but it used to work before react-scripts was introduced!
I had some extra config at Webpack config such as:

   new webpack.ProvidePlugin({
      $: 'jquery',
       jQuery: 'jquery',
       'window.jQuery': 'jquery'
   })

AND

new CopyWebpackPlugin([
     {from: root('public/html'), to: root('dist/html')},
     {from: root('public/lang'), to: root('dist/lang')},
     {from: root('public/productDesigner'), to: root('dist/productDesigner')},
])

Did you try recovering your dependencies?

Yes.

Which terms did you search for in User Guide?

react-scripts, Webpack ProvidePlugin, CopyWebpackPlugin
Tried to apply some a solution from #4281 by importing globals.js

Steps to Reproduce

I have added the code at codesandbox https://codesandbox.io/s/871o94jn9

Error

jQuery.Deferred exception: FancyProductDesigner is not defined 
componentDidMount

Let me know your thoughts,
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions