question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

String is modified in the production build

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
agentcoopercommented, 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.

0reactions
Timercommented, Jun 1, 2018

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

Thanks for the report!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Editing a string in the result of a reactapp built with "yarn build ...
I have some reactapp that I build using yarn build --production . In that app there is some string that I want to...
Read more >
The StringBuilder Class - The Java™ Tutorials
StringBuilder objects are like String objects, except that they can be modified. Internally, these objects are treated like variable-length arrays that ...
Read more >
Configure application settings for Azure Static Web Apps
In this article ... Application settings hold configuration values that may change, such as database connection strings. Adding application ...
Read more >
Handling text — strings in JavaScript - Learn web development
In the next article, we'll build on this, looking at some of the built-in methods available to strings in JavaScript and how we...
Read more >
How To Debug React Components Using React Developer ...
DigitalOcean React Production Build information ... that splits the text into an array of characters using the split() string method.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found