Initialized paraglide via pnpx @inlang/paraglide-js@latest init
Added a vite.config.ts:
import { defineConfig } from 'vite'
import { paraglide } from '@inlang/paraglide-js-adapter-vite'
export default defineConfig({
plugins: [
paraglide({
project: './project.inlang', // Path to your inlang project
outdir: './src/paraglide' // Where you want the generated files to be placed
})
]
})
Started the project via pnpm dev and received:
Using existing cloned repo
Using existing cloned repo
Using existing cloned repo
node:internal/crypto/hash:104
throw new ERR_INVALID_ARG_TYPE(
^
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
at Hash.update (node:internal/crypto/hash:104:11)
at hashMessages (file:///workspaces/slidev-theme-i18n/node_modules/.pnpm/@inlang+paraglide-js-adapter-unplugin@1.4.18/node_modules/@inlang/paraglide-js-adapter-unplugin/dist/index.js:90:10)
at triggerCompile (file:///workspaces/slidev-theme-i18n/node_modules/.pnpm/@inlang+paraglide-js-adapter-unplugin@1.4.18/node_modules/@inlang/paraglide-js-adapter-unplugin/dist/index.js:21:37)
at Context.buildStart (file:///workspaces/slidev-theme-i18n/node_modules/.pnpm/@inlang+paraglide-js-adapter-unplugin@1.4.18/node_modules/@inlang/paraglide-js-adapter-unplugin/dist/index.js:67:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 4)
at async hookParallel (file:///workspaces/slidev-theme-i18n/node_modules/.pnpm/vite@5.2.7/node_modules/vite/dist/node/chunks/dep-C-KAszbv.js:50654:9)
at async Object.buildStart (file:///workspaces/slidev-theme-i18n/node_modules/.pnpm/vite@5.2.7/node_modules/vite/dist/node/chunks/dep-C-KAszbv.js:51006:13)
at async file:///workspaces/slidev-theme-i18n/node_modules/.pnpm/vite@5.2.7/node_modules/vite/dist/node/chunks/dep-C-KAszbv.js:64895:13
at async httpServer.listen (file:///workspaces/slidev-theme-i18n/node_modules/.pnpm/vite@5.2.7/node_modules/vite/dist/node/chunks/dep-C-KAszbv.js:64913:17) {
code: 'ERR_INVALID_ARG_TYPE'
}
Node.js v20.10.0
Seems to be caused by a bug in the Inlang SDK. I've added some defensive coding to the vite plugin to make sure it can recover from it & work as expected
What I've done:
pnpx @inlang/paraglide-js@latest init
Added a
vite.config.ts
:Started the project via
pnpm dev
and received:The project is here: https://github.com/openscript-ch/slidev-theme-i18n