opral / inlang-paraglide-js

Tree-shakable i18n library build on the inlang ecosystem.
https://inlang.com/m/gerre34r/library-inlang-paraglideJs
24 stars 0 forks source link

bug: sveltekit adapter >=0.5.14 (it's dependency) breaks prod build #51

Closed ZerdoX-x closed 3 months ago

ZerdoX-x commented 3 months ago

Reproduction url: https://git.sr.ht/~zerdox/paraglide-js-adapter-sveltekit-51 Steps:

  1. npm i
  2. npm run build
  3. see logs

Warning when running locally:

✓ 109 modules transformed.
vite v5.2.4 building for production...
valid repo url / local repo not found, only limited features will be available.
Using existing cloned repo

Error: (for some reason it occurs only in my production docker build)

#18 11.32 @tonna/profile:build: ✓ 0 modules transformed.
#18 11.32 @tonna/profile:build: x Build failed in 6ms
#18 11.33 @tonna/profile:build: error during build:
#18 11.33 @tonna/profile:build: Error: [unplugin-paraglide] repo url is required, use file:// for local repos
#18 11.33 @tonna/profile:build:     at openRepository (file:///workspace/node_modules/.pnpm/@lix-js+client@1.1.0/node_modules/@lix-js/client/dist/openRepository.js:37:15)
#18 11.33 @tonna/profile:build:     at getProject (file:///workspace/node_modules/.pnpm/@inlang+paraglide-js-adapter-unplugin@1.4.15/node_modules/@inlang/paraglide-js-adapter-unplugin/dist/index.js:51:28)
#18 11.33 @tonna/profile:build:     at async Object.buildStart (file:///workspace/node_modules/.pnpm/@inlang+paraglide-js-adapter-unplugin@1.4.15/node_modules/@inlang/paraglide-js-adapter-unplugin/dist/index.js:65:29)
#18 11.33 @tonna/profile:build:     at async Promise.all (index 3)
#18 11.33 @tonna/profile:build:     at async PluginDriver.hookParallel (file:///workspace/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:19491:9)
#18 11.33 @tonna/profile:build:     at async file:///workspace/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:20396:13
#18 11.33 @tonna/profile:build:     at async catchUnfinishedHookActions (file:///workspace/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:19907:16)
#18 11.33 @tonna/profile:build:     at async rollupInternal (file:///workspace/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:20393:5)
#18 11.33 @tonna/profile:build:     at async build (file:///workspace/node_modules/.pnpm/vite@5.2.0-beta.0_@types+node@20.11.30_lightningcss@1.24.1/node_modules/vite/dist/node/chunks/dep-BxRAmRCV.js:67107:18)
#18 11.33 @tonna/profile:build:     at async CAC.<anonymous> (file:///workspace/node_modules/.pnpm/vite@5.2.0-beta.0_@types+node@20.11.30_lightningcss@1.24.1/node_modules/vite/dist/node/cli.js:842:9)

This warning and error does not appear on <=0.5.12 (could not test on 0.5.13 as it's not functional). So I don't know which release got this breaking change, either 0.5.13 or 0.5.14

I could not see any required changes I need to make to configuration in any of changelogs + all guides remain the same, so I guess this is a bug?..

If it's not enough for reproduction, I could probably configure a similar minimal dockerfile to cause prod build to fail

ZerdoX-x commented 3 months ago

CC @HokkaidoInu from https://github.com/opral/inlang-paraglide-js/discussions/42#discussioncomment-8915359

I'm having the same message when using version 1.2.24 and upwards of "@inlang/paraglide-js-adapter-vite"

LorisSigrist commented 3 months ago

Thanks for reporting, I'll take a look

LorisSigrist commented 3 months ago

For now, the error should go away if you initialize a git repo. There was an update to the inlang SDK that introduced some weird behavior here.

ZerdoX-x commented 3 months ago

For now, the error should go away if you initialize a git repo. There was an update to the inlang SDK that introduced some weird behavior here.

Um.. so the error occurs in my prod docker because it's not in a git repo? I guess it's easier for me to stay on 0.5.12 and just wait for the upstream fix.

Thank you for such quick response! Glad to help with bugs, not that hard to make a good report ;)

LorisSigrist commented 3 months ago

Um.. so the error occurs in my prod docker because it's not in a git repo?

Yeah, it's unintuitive behavior. Should be a quick fix though, I'm pretty sure I know what's wrong

LorisSigrist commented 3 months ago

Should be fixed in version 0.5.17 which will be available in a few minutes

ZerdoX-x commented 3 months ago

I'll try it as soon as it will be available and give you feedback on it

ZerdoX-x commented 3 months ago

Seems like 30 mins is not enough for npm registry. Could you double check it's released? If yes, I'll just check it later