-
Notifications
You must be signed in to change notification settings - Fork 120
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
PrimeReact: Can't resolve 'primelocale' in v2 #218
Comments
@juliecki we now have a way more improved way to load them as JavaScript instead of JSON. See: https://stackblitz.com/edit/axcck4-nuukjdrw?file=src%2FApp.tsx |
Thanks! I now changed it to
But now I get this error:
Is it caused by the
|
yeah it looks like thta stackblitz has... {
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"module": "ESNext",
"skipLibCheck": true,
"allowJs": true,
/* Bundler mode */
"moduleResolution": "node",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
} |
Still don't get it work when I configure it like in stackblitz. I saw that the stackblitz project is built with Vite, but we don't have yet migrated to Vite and are still using CRA. I don't know if this is causing issues as well. |
@blutorange any thoughts with CRA? Yeah everything is working fine with Vite and NextJS. |
On top of my head, without trying it out: Try setting resolvePackageJsonExports to Do you have minimal reproduction? |
@blutorange we have a simple CRA basic app here https://github.com/primefaces/primereact-examples you can just grab that and try with PrimeLocale 2.0.1 since its already set up CRA app. |
But anyways, I'm getting the same error with @juliecki Can you try editing
|
Adding this to the
and having Althought, this error now occurs in my jest tests:
|
I've upgraded from
v1.6.0
->v2.0.1
.Since then, I cannot import the needed primelocale dynamically.
It's used like this:
But then I get the Error:
Module not found: Error: Can't resolve 'primelocale'
PrimeReact:
"primereact": "10.9.1"
React:
"react": "18.3.1"
TypeScript:
"typescript": "5.7.2"
The text was updated successfully, but these errors were encountered: