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

String is modified in the production build #4100

Closed
agentcooper opened this issue Mar 1, 2018 · 7 comments
Closed

String is modified in the production build #4100

agentcooper opened this issue Mar 1, 2018 · 7 comments

Comments

@agentcooper
Copy link

Is this a bug report?

Yes.

Did you try recovering your dependencies?

This is about a clean new project.

Environment

  1. node -v: 8.9.4
  2. npm -v: 5.6.0
  3. npm ls react-scripts: 1.1.1
  4. Operating system: macOS

Steps to reproduce

  1. create-react-app minification-test && cd minification-test
  2. Replace App.js with
import React, { Component } from 'react';

class App extends Component {
  render() {
    const test = `<Script></Script>`;

    return (
      <p>{test}</p>
    );
  }
}

export default App;
  1. npm run build
  2. serve -s build (npm install serve -g if needed)

Expected behavior

I expect to see <Script></Script> on the screen.

Actual behavior

I see <Script></script> – the second script is lowercase.

Reproducible demo

npm start:
ok

Build:
broken

@agentcooper
Copy link
Author

agentcooper commented Mar 1, 2018

This looks like an UglifyJS issue, it is reproducible in UglifyJS playground with following code:

const test = `<Script></Script>`;

and inline_script option enabled.

@Timer
Copy link
Contributor

Timer commented Mar 5, 2018

Could you please file this issue with Uglify and link back here? Thank you!

@Timer Timer added this to the 100.0.0 milestone Mar 5, 2018
@unknownMarty
Copy link

Same issue here. I'm using react-chartkick that requires charts.js Guess this is related
No charting library found for t Removing Uglify inside webpack.config.prod.js is temp workaround for me.

@Timer
Copy link
Contributor

Timer commented Mar 6, 2018

Should we disable inline_script for now? What are those implications?

Can you please try react-scripts@2 and see if it persists in the beta?

@agentcooper
Copy link
Author

Linking the issue: mishoo/UglifyJS#2989.

@Timer Timer modified the milestones: 100.0.0, 2.0.0 Apr 15, 2018
@miraage
Copy link

miraage commented Apr 18, 2018

FYI: mishoo/UglifyJS#2991

@Timer
Copy link
Contributor

Timer commented Jun 1, 2018

Looks like this was fixed in Uglify. It'll work its way in here eventually.

Thanks for the report!

@Timer Timer closed this as completed Jun 1, 2018
@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants