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

DevTools failed to load source map: Could not load content for http://localhost:3000/@vite/client.mjs.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE #82

Closed
kazupon opened this issue Jan 26, 2022 · 3 comments
Labels
help wanted Extra attention is needed Package: vite-plugin-vue-i18n Status: PR Welcome Welcome to Pull Request

Comments

@kazupon
Copy link
Member

kazupon commented Jan 26, 2022

We are missing a source map with @intlify/[email protected] on dev mode

Console Error

DevTools failed to load source map: Could not load content for http://localhost:3000/@vite/client.mjs.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Steps to reproduce

  1. Create a new project with npm init vite@latest my-vue-app -- --template vue
  2. Install vue-i18n with npm i @intlify/vite-plugin-vue-i18n vue-i18n
  3. Add i18n plugin to vite.config.js
  4. Run dev mode npm run dev to inspect

package.json

{
  "name": "my-vue-app",
  "version": "0.0.0",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "@intlify/vite-plugin-vue-i18n": "^3.2.1",
    "vue": "^3.2.25",
    "vue-i18n": "^9.1.9"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^2.0.1",
    "vite": "^2.7.12"
  }
}

vite.config.js

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import i18n from '@intlify/vite-plugin-vue-i18n'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), i18n()],
})

Environment

macOS 12.1
Node 14.18.2
npm 8.3.1
Chrome 97
Safari 15.2

I can see the inlined source map for http://localhost:3000/@vite/client when I don't have installed the plugin, that's why I suspect that it's related.

I don't know how I can help to fix it, I hope somebody can address me.

Originally posted by @fcomrqz in #1 (comment)

@kazupon kazupon added help wanted Extra attention is needed Package: vite-plugin-vue-i18n Status: PR Welcome Welcome to Pull Request labels Jan 26, 2022
@Topograph
Copy link

this currently prevents us from getting correct sourcemaps for any vue component in our project, as long as vite-plugin-vue-i18n is included in our vite.config.ts.

Is there any workaround for preventing the vite-plugin-vue-i18n to mess with the sourcemaps at all?

@Ragura
Copy link

Ragura commented Feb 23, 2022

Not with the newest version. You need to downgrade to version 3.1.1 to prevent it.
I tried looking into fixing it, but couldn't figure it out. I understand that @kazupon doesn't immediately see a way to resolve it either, so it would be nice if the faulty source map implementation could just be reverted, then we can upgrade normally again.

@kazupon
Copy link
Member Author

kazupon commented Mar 3, 2022

resolved with v3.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Package: vite-plugin-vue-i18n Status: PR Welcome Welcome to Pull Request
Projects
None yet
Development

No branches or pull requests

3 participants