monorepo: [bug] [SDK] project_id not found

Problem

From https://discord.com/channels/897438559458430986/1198317791799935107

CleanShot 2024-01-21 at 00 36 44@2x

Expected behavior

If no project id can be generated, loadProject should not throw (until https://github.com/opral/monorepo/issues/2069 is implemented)

Reproduction

not provided

Other information

No response

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 35 (35 by maintainers)

Most upvoted comments

With @KraXen72 's help, I think we have confirmed that a project.inlang project path in the vite.config was very likely the root cause of the errors reported. We believe it only manifested after updating npm packages because the old vite adapter was not actively running (and messages were still being compiled manually by invoking the cli) before the update.

package.json settings.json for inlang vite.config.ts - this is after i chaged everything from ‘pursiny-sveltekit.inlang’ to ‘project.inlang’ to get it to work. to get the setup i had previously, do a search&replace on the vite config & package.json, also rename the directory to pursiny-sveltekit.inlang.

import { defineConfig, normalizePath } from 'vite';
import { resolve } from 'node:path';

import copy from 'rollup-plugin-copy'
import { sveltekit } from '@sveltejs/kit/vite';
import ViteRestart from 'vite-plugin-restart';
import { paraglide } from '@inlang/paraglide-js-adapter-vite';
import UnoCSS from 'unocss/vite';


export default defineConfig(({ command }) => {
	const config = {
		plugins: [
			UnoCSS(),
			sveltekit(),
			paraglide({
				project: './project.inlang',
				outdir: './src/paraglide',
			}),
			ViteRestart({ restart: 'mdsvex.config.js' }),
		],
		server: {
			fs: {
				allow: ['posts'] // required by mdsvex & our strategy
			},
		},
		optimizeDeps: {
			exclude: ['@inlang/paraglide-js']
		},
		ssr: {
			noExternal: ['@inlang/paraglide-js']
		},
	}
	if (command === 'build') {
		const copyPlugin = copy({
			targets: [
				{ 
					src: ['db/*.htaccess', 'db/schema.json', 'db/*SCINDEX.json', 'db/vtmeta.yml'], 
					dest: normalizePath(resolve('.svelte-kit', 'adapter-iis', 'db'))
				},
				{
					src: ['static/krpano_svelte_actions.xml'],
					dest: normalizePath(resolve('static-prod'))
				}
			],
			hook: 'writeBundle',
			overwrite: true
		})

		config.plugins.push(copyPlugin)
	}

	return config

});

this is how my directories are set up: image

changing the folder to explicitly say ‘project.inlang’ instead of ‘pursiny-sveltekit.inlang’ fixed the issue.

THis is a bug.

@jldec can you investigate?

in one of you guys’ dms on discord - which one should i send it to? thanks.

send it to @jldec

I’ll try updating all inlang packages to latest version, and then if it still doesen’t work i’ll send the repo in one of you guys’ dms on discord - which one should i send it to? thanks.