Can't load sourcemaps for node modules in renderer
See original GitHub issueThe modules themselves are working fine, and the sourcemaps are there in their respective folders in node_modules
, but the renderer can’t load them:
DevTools failed to load source map: Could not load content for http://127.0.0.1:5173/resolve.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
I didn’t see any existing issues about this so maybe something to do with my setup:
/* eslint-env node */
import vue from "@vitejs/plugin-vue";
import { join } from "path";
import { defineConfig } from "vite";
import renderer from "vite-plugin-electron-renderer";
const PACKAGE_ROOT = __dirname;
export default defineConfig({
mode: process.env.MODE,
root: PACKAGE_ROOT,
envDir: process.cwd(),
resolve: {
alias: {
"@": join(PACKAGE_ROOT, "src"),
"!": join(PACKAGE_ROOT, "assets"),
$: join(PACKAGE_ROOT, "../common"),
},
},
base: "",
server: {
fs: {
strict: true,
},
},
build: {
sourcemap: true,
target: `es2022`,
outDir: "dist",
assetsDir: ".",
rollupOptions: {
input: join(PACKAGE_ROOT, "index.html"),
output: {
entryFileNames: "[name].cjs",
},
},
emptyOutDir: true,
reportCompressedSize: false,
lib: {
entry: "src/index.ts",
formats: ["cjs"],
},
},
plugins: [
vue(),
renderer({
resolve() {
return ["path", "fs", "stream", "os", "child_process", "node-fetch", "spring-map-parser", "tachyon-client", "sdfz-demo-parser", "octokit"];
},
}),
],
});
Any ideas how I can fix these, or otherwise hide the warnings?
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top Results From Across the Web
DevTools failed to load SourceMap for webpack ...
The source map you are trying to load is in node_modules and not part of webpack bundle. "If not extracted and processed into...
Read more >yarn dev result has error Cannot find module 'source-map ...
Clone repo. Run yarn. Run yarn dev. Built app launches with an error already displayed in the open devtools console. Uncaught Error: Cannot...
Read more >source-map-loader - webpack
The source-map-loader will extract from any JavaScript file, including those in the node_modules directory. Be mindful in setting include and exclude rule ...
Read more >could not load content for webpack - You.com | The AI Search ...
The source map you are trying to load is in node_modules and not part of webpack bundle. "If not extracted and processed into...
Read more >Using Source Maps - Javascript Honeybadger Documentation
Node.js Integration Guide · Server-Side Rendering. Uploading Your Source Map. Upload your source map(s) every time you ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The next version will be generate
.map.js
into.vite-electron-renderer
Ok, I found that installing https://github.com/vite-plugin/vite-plugin-esmodule fixes most of these warnings