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

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

Closed
rfdc opened this issue Feb 12, 2019 · 1 comment

Comments

@rfdc
Copy link

rfdc commented Feb 12, 2019

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

@petetnt
Copy link
Contributor

petetnt commented Feb 15, 2019

Hi rfdc,

sadly we don't support customization of Webpack configs. Check https://github.com/timarney/react-app-rewired on how to customize react-scripts if needed, although we cannot provide support for it.

That said you probably need to copy the files manually to the public folder in your case to work properly with globals.js.

@petetnt petetnt closed this as completed Feb 15, 2019
@lock lock bot locked and limited conversation to collaborators Feb 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants