Comments (6)
from js-lingui.
Sorry, i could not debug code for you. Did you check that version of SWC core is compatible with version of lingui swc plugin? What is the error message?
from js-lingui.
Sorry, i could not debug code for you. Did you check that version of SWC core is compatible with version of lingui swc plugin? What is the error message?
![image](https://private-user-images.githubusercontent.com/45024986/354232349-a63f1535-c0f2-45d0-9e62-4dd57b01dc97.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM2OTIzMDksIm5iZiI6MTcyMzY5MjAwOSwicGF0aCI6Ii80NTAyNDk4Ni8zNTQyMzIzNDktYTYzZjE1MzUtYzBmMi00NWQwLTllNjItNGRkNTdiMDFkYzk3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDAzMjAwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU5NDI2YjVmZWNhYjk4MmJiNmE3YzQ2YjIxZDcyYjBjNjZmMDhhOWUxNDk1ODczODJjNTU5MDY4ZDU0YzJjNzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.1dGk6iBbjtuWcL89_jUGvONKw8g7_WQYcP75tHQF87E)
// package.json
{
"name": "lingui-test",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@lingui/macro": "^4.11.2",
"@lingui/react": "^4.11.2",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@lingui/cli": "^4.11.2",
"@lingui/swc-plugin": "^4.0.8",
"@lingui/vite-plugin": "^4.11.2",
"@swc/core": "^1.7.4",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"typescript": "^5.2.2",
"vite": "^5.3.5"
}
}
// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import { lingui } from "@lingui/vite-plugin";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
plugins: [['@lingui/swc-plugin', {}]],
}),
lingui(),
],
})
from js-lingui.
You have incompatibility between swc-core and lingui swc plugin. Please remove ^
from @swc/core
and @lingui/swc-plugin
.
Also check compatibility table
from js-lingui.
Also this explcitly stated in the vite-swc example readme https://github.com/lingui/js-lingui/tree/main/examples/vite-project-react-swc#example-project-using-vite--swc-compiler-with-linguijs-plugin
and specific version of @swc/core
fixed used resolutions field, as well as @lingui/swc-plugin
specified without a caret symbol.
from js-lingui.
I had the same problem, did a pnpm update and swc that came with the @vitejs/plugin-react-swc
got updated to 1.7 behind the scenes and lingui started failing. I checked from the history that the previous version was 1.6.5.
I added the following key to package.json:
"resolutions": {
"@swc/core": "~1.6.5"
},
cleared node_modules, and .swc and executed a clean install. Now it's working and swc/core is set to 1.6.13.
P.S I couldn't make heads or tails of the compatibility matrix. It's a bit late here.
from js-lingui.
Related Issues (20)
- t`` macro doesn't work when load and activate message HOT 2
- Avoid flashing of the default language HOT 1
- Ids are displayed sometimes on production build HOT 7
- Getting an error when using with vite and swc HOT 2
- `lingui extract <..files>` overwrites obsolete flag HOT 1
- Upgrade @lingui/cli's cli-table dependency
- Example of nextjs integration without internationalized routing HOT 1
- Support additional + bespoke metadata on messages HOT 5
- Migrate to the latest version of Lerna
- v5 experimental extractor esbuild "packages" config HOT 2
- Trans from @lingui/react/macro works with React.Key will print a warning message
- Lingui v5 preview - issues with multiline messages HOT 3
- multi-line comment not formatted correctly HOT 1
- Provide a webpack.config or resolver option to the `experimental-extractor`
- [Idea] Use comments to define message placeholder names
- LinguiJS & Next.js standalone build not working HOT 3
- Monorepo: Per-package Lingui config requires `locales` key HOT 1
- Update @lingui/cli to use glob version > 9 HOT 1
- NextJS 14.2.5 and Lingui 4.11.x issues following example app as outline HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-lingui.