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.

Built result will be different when environment change or node_modules be reinstalled

See original GitHub issue

Describe the bug Build result will change when reinstall node_modules. This will lead to the problem of the source code review when the expanded store is launched. As I encountered, when upload to firefox addon center, the code-reviewer reminded the code built result differently from the uploaded code.

To Reproduce Steps to reproduce the behavior:

  1. npm run build
  2. Save production zip file
  3. Delete node_modules dir
  4. npm install && npm run build
  5. compare the two production file

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
spekulatiuscommented, Aug 30, 2022

Yeah, I know Mozilla likes to have deterministic code. It’s understandably desirable to have the same output each time, hence my surprise about the issue.

I’m happy you found a solution that works for you.

0reactions
Taoskycommented, Aug 30, 2022

You mean files in a different order in the ZIP file?

What I mean is that the location of the final generated JS code in the file may change, or the variable name may change (sorry, I don’t know much about the code after the build, in short, after each build, the generated code changed)

In most cases, this change will not cause problems, but mozilla requires that extensions that use webpack upload source code for review. I think they might use something like ‘diff’ in the background to compare the results.

When uploading to chrome webstore or microsoft store (Edge) there is no problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do Node modules go into .staging folder? - Stack Overflow
Note: - ".staging" means, those dependencies are getting downloaded so for the temporary basis it keeps all those dependencies under ".staging" ...
Read more >
JavaScript Best Practices and node_modules - Julie Ng
The JavaScript ecosystem and how it stores modules locally in the project can be frickle. Especially when coming from another language, ...
Read more >
How To Use Node.js Modules with npm and package.json
The first step will be to create and understand the package.json file. You will then use it to keep track of all the...
Read more >
What's Really Going On Inside Your node_modules Folder?
Anyone running npm install without a package-lock.json file was compromised. Anyone unlucky enough to update to a new version of ua-parser-js , ...
Read more >
[FEATURE] Do not remove node_modules on npm ci #564
Only install/remove a package if its version in node_modules and the main package. json are different, OR if the package is completely missing ......
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