sergiodxa / remix-i18next

The easiest way to translate your Remix apps
https://sergiodxa.github.io/remix-i18next/
MIT License
616 stars 44 forks source link

Sourcemap for ...remix-i18next/build/server.js points to missing source files #204

Open juniorforlife opened 3 months ago

juniorforlife commented 3 months ago

Describe the bug

I'm using the latest version 6.3.0 of remix-i18next with Remix v2.10.3. When I run bun dev the terminal shows these warnings

Sourcemap for "/node_modules/remix-i18next/build/react.js" points to missing source files
Sourcemap for "/node_modules/remix-i18next/build/server.js" points to missing source files
Sourcemap for "/node_modules/remix-i18next/build/lib/parser.js" points to missing source files
Sourcemap for "/node_modules/remix-i18next/build/lib/get-client-locales.js" points to missing source files
Sourcemap for "/node_modules/remix-i18next/build/lib/format-language-string.js" points to missing source files

Your Example Website or App

private repo

Steps to Reproduce the Bug or Issue

  1. Install remix-i18next
  2. Run bun dev (remix vite:dev)
  3. Check the terminal

Expected behavior

No warning

Screenshots or Videos

No response

Platform

Additional context

No response

sergiodxa commented 3 months ago

Sourcemaps files are published to npm and generated automatically by the TS compiler.

I tried in a Remix app using Vite with latest release of remix-i18next I don't see any warning.

If you can create a minimal reproduction I can take a look.

bartekus commented 3 months ago

This issue is related to incorrect map file reference when the npm package is being consumed: image image As you can see in the above, the "sources":["../src/client.ts"] is incorrectly pointing to a source file which is not available when using build distribution. One can manually patch this by changing these references to TS dictionary files that are available along side of the transpired ones like so: "sources":["./client.d.ts"]

By doing the above for all the files in the build and lib directory, these error go away.

Abdorithm commented 2 months ago

I have the exact warnings with remix-i18next 6.3.0 with the latest stable Remix from their official page. when I run

npm run dev

2024-09-09_19-35

Abdorithm commented 2 months ago

This issue is related to incorrect map file reference when the rpm package is being consumed: image image As you can see in the above, the "sources":["../src/client.ts"] is incorrectly pointing to a source file which is not available when using build distribution. One can manually patch this by changing these references to TS dictionary files that are available along side of the transpired ones like so: "sources":["./client.d.ts"]

By doing the above for all the files in the build and lib directory, these error go away.

This solution by @bartekus solved the issue for me!

jrestall commented 2 months ago

Am also getting sourcemap errors on every dev server start.

image
heivo commented 2 weeks ago

Same for me