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

Missing $lib/paraglide from skeleton project #258

Open
pe1uca opened this issue Oct 31, 2024 · 8 comments
Open

Missing $lib/paraglide from skeleton project #258

pe1uca opened this issue Oct 31, 2024 · 8 comments
Labels
bug Something isn't working pkg:add sv add

Comments

@pe1uca
Copy link

pe1uca commented Oct 31, 2024

When creating a project using bunx sv create new-project and selecting the options below, the app doesn't run with error ENOENT: No such file or directory

This seems to be because the project doesn't include the files necessary inside src/lib/paraglide which are referenced in the vite.config.ts file.
After commenting the paraglide plugin and the references in the project it can properly start.

┌  Welcome to the Svelte CLI! (v0.5.11)
│
◇  Which template would you like?
│  SvelteKit minimal
│
◇  Add type checking with Typescript?
│  Yes, using Typescript syntax
│
◆  Project created
│
◇  What would you like to add to your project? (use arrow keys / space bar)
│  prettier, eslint, vitest, playwright, tailwindcss, drizzle, lucia, paraglide
│
◇  tailwindcss: Which plugins would you like to add?
│  forms, container-queries, aspect-ratio
│
◇  drizzle: Which database would you like to use?
│  PostgreSQL
│
◇  drizzle: Which PostgreSQL client would you like to use?
│  Postgres.JS
│
◇  drizzle: Do you want to run the database locally with docker-compose?
│  Yes
│
◇  lucia: Do you want to include a demo? (includes a login/register page)
│  Yes
│
◇  paraglide: Which languages would you like to support? (e.g. en,de-ch)
│  es,en
│
◇  paraglide: Do you want to include a demo?
│  Yes
│
◇  Which package manager do you want to install dependencies with?
│  bun
@AdrianGonz97
Copy link
Member

Unfortunately, I'm unable to replicate the issue with the provided selections. Can you trim it down to only the minimally reproducible portions (i.e. only selecting paraglide rather than every add-on) and providing a link to a reproduction repo?

@pe1uca
Copy link
Author

pe1uca commented Nov 4, 2024

Same thing with minimal options selected, here's the link to the repo https://github.com/pe1uca/testSvCreate

┌  Welcome to the Svelte CLI! (v0.5.11)
│
◇  Which template would you like?
│  SvelteKit minimal
│
◇  Add type checking with Typescript?
│  Yes, using Typescript syntax
│
◆  Project created
│
◇  What would you like to add to your project? (use arrow keys / space bar)
│  paraglide
│
◇  Which languages would you like to support? (e.g. en,de-ch)
│  es,en
│
◇  Do you want to include a demo?
│  Yes
│
◇  Which package manager do you want to install dependencies with?
│  bun
│
◆  Successfully setup integrations
│
◇  Successfully installed dependencies

@geko1971
Copy link

geko1971 commented Nov 6, 2024

@pe1uca I experienced the same issue, but it was eventually simply the fetch of inlang plugins from https://cdn.jsdelivr.net failing at compilation time.

When running pnpm dev I got several errors like the following:

ERROR  Couldn't import the plugin "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@1/dist/index.js":

ModuleImportError: Couldn't import the plugin "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@1/dist/index.js":

TypeError: fetch failed

I solved by disabling SSL verification for the process as a workaround.

HTH...

@dominikg
Copy link
Member

dominikg commented Nov 6, 2024

you can load the inlang plugins from node_modules via fs path instead. just install the packages for them as devDependency.

@waedi
Copy link

waedi commented Nov 9, 2024

you can load the inlang plugins from node_modules via fs path instead. just install the packages for them as devDependency.

Can you give some more detailed instructions, please? I am pretty new and cannot get it to work.
bun add complains about blocked postinstalls and the provided steps to solve those don't work either.
Then I also do not know where I have to load the inlang plugins.
Maybe I should abandon bun for the moment.

@manuel3108
Copy link
Member

Since this seems to be problematic for at least 3 users , we should check if we can find another way to do this.

@paoloricciuti
Copy link
Member

you can load the inlang plugins from node_modules via fs path instead. just install the packages for them as devDependency.

Can you give some more detailed instructions, please? I am pretty new and cannot get it to work. bun add complains about blocked postinstalls and the provided steps to solve those don't work either. Then I also do not know where I have to load the inlang plugins. Maybe I should abandon bun for the moment.

Yeah I actually did it for job and you have to patch the package to remove the post install.

Curiously they basically just read the file and eval it instead of actually importing it so if you really want I guess you could include it just as a copy pasted file

@dominikg
Copy link
Member

dominikg commented Nov 9, 2024

you add this in paraglide settings.json instead of the jsdelivr urls

	"modules": [
		"node_modules/@inlang/message-lint-rule-empty-pattern/dist/index.js",
		"node_modules/@inlang/message-lint-rule-identical-pattern/dist/index.js",
		"node_modules/@inlang/message-lint-rule-missing-translation/dist/index.js",
		"node_modules/@inlang/message-lint-rule-without-source/dist/index.js",
		"node_modules/@inlang/message-lint-rule-valid-js-identifier/dist/index.js",
		"node_modules/@inlang/plugin-message-format/dist/index.js",
		"node_modules/@inlang/plugin-m-function-matcher/dist/index.js"
	],

and you have to install each of the ones you need as devDependency. To prevent them from executing scripts you can use pnpms onlyBuiltDependencies or neverBuiltDependencies feature or just disable all post-install scripts (thats a safer environment but you might have some deps that depend on it working, put those in onlyBuiltDependencies then

https://pnpm.io/package_json#pnpmonlybuiltdependencies

@manuel3108 manuel3108 added bug Something isn't working pkg:add sv add labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:add sv add
Projects
None yet
Development

No branches or pull requests

7 participants