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

vite build - source map generation errors because of file replace plugin #14022

Closed
ghost opened this issue Dec 26, 2022 · 3 comments · Fixed by #14104
Closed

vite build - source map generation errors because of file replace plugin #14022

ghost opened this issue Dec 26, 2022 · 3 comments · Fixed by #14104
Assignees
Labels
outdated scope: bundlers Issues related to webpack, rollup type: bug

Comments

@ghost
Copy link

ghost commented Dec 26, 2022

Current Behavior

In >=15.4.0, when running a build with vite that includes sourcemaps (either hidden or inline) the sourcemaps are not generated because of the following error:

Sourcemap is likely to be incorrect: a plugin (rollup-plugin-replace-files) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help

This does not happen in 15.3.3, and seems to be impacted by this PR.

Expected Behavior

Sourcemaps should be generated without errors

Github Repo

No response

Steps to Reproduce

  1. Create a repo with a React + Vite project
  2. Include sourcemap: "inline" in "production" configuration of the build target (or some other target)
  3. Run a build

Nx Report

Node : 16.16.0
   OS   : darwin arm64
   yarn : 3.3.1
   
   nx : 15.4.1
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.4.1
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.4.1
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.4.1
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.4.1
   @nrwl/js : 15.4.1
   @nrwl/linter : 15.4.1
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : 15.4.1
   @nrwl/nx-cloud : 15.0.2
   @nrwl/nx-plugin : 15.4.1
   @nrwl/react : 15.4.1
   @nrwl/react-native : Not Found
   @nrwl/rollup : 15.4.1
   @nrwl/schematics : Not Found
   @nrwl/storybook : 15.4.1
   @nrwl/web : 15.4.1
   @nrwl/webpack : 15.4.1
   @nrwl/workspace : 15.4.1
   @nrwl/vite : 15.4.1
   typescript : 4.9.4
   ---------------------------------------
   Local workspace plugins:
         @island/workspace
   ---------------------------------------
   Community plugins:
         nx-stylelint: 14.0.2

Failure Logs

Sourcemap is likely to be incorrect: a plugin (rollup-plugin-replace-files) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help

Additional Information

No response

@ghost ghost added the type: bug label Dec 26, 2022
@nmorozov
Copy link

nmorozov commented Dec 27, 2022

Same problem. After install version 15.4.1 sourcemaps looks like:

{"version":3,"file":"index-fdf47e50.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

I rolled back @nrwl/vite to 15.3.3

UPDATE: I've removed fileReplacements key from the project.json, and it works

@ghost
Copy link
Author

ghost commented Dec 27, 2022

makes sense, because then the plugin won't take any action

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: bundlers Issues related to webpack, rollup type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants