-
Notifications
You must be signed in to change notification settings - Fork 33
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
Support for PNPM (astro-i18next throws with "module is not defined") #48
Comments
Apparently the problem are not monorepos but PNPM. If you install with WorkaroundAdd this file to your root : /.npmrc public-hoist-pattern[]="*deepmerge*"
public-hoist-pattern[]="*proload*"
public-hoist-pattern[]="*locale-emoji*" |
While I haven't used the module yet, I'm a big fan of both astro and pnpm so I had a quick look at the source. First thing I notice is these 2 imports:
Both should probably import from "./types" (or ./types.ts - I never know if the extension is required). Other than that, I see these imports, all from dev deps. Probably should be regular deps:
With those fixes, pnpm might be happy without resorting to |
When I try to use
<Trans />
,<HeadHrefLangs />
,<LanguageSelector />
,interpolate
, etc I get the following error :I'm using
pnpm
andturborepo
, reproduction (error atapps/frontend/src/layouts/Layout.astro
line 2 & 19):https://github.com/Alexandre-Fernandez/turborepo-astro-nestjs
Astro app is located in
/apps/frontend
, commands to get the error :pnpm install
pnpm dev --filter frontend
EDIT:
This might happen because it's trying to load from the monorepo root
/node_modules
instead of its corresponding workspace/apps/frontend/node_modules
.I say that because I get a different error (another missing dependency) when I install
deepmerge@4.2.2
in the rootpackage.json
(pnpm add deepmerge@4.2.2 -w
).This only happens with
astro-i18next
and not withi18next
.The text was updated successfully, but these errors were encountered: