Closed dalton5 closed 1 year ago
@inlang/ide-extension
@dalton5 It seems to me that your json file can't be parsed correctly. Can you share your json? Or the structure of it?
en.json
{
"home": "Home",
"an-error-has-happened-during-the-launch": "An error has happened during the launch",
"our-villas": "Our lodges",
"your-journey": "Your journey",
"local-advices": "Local Advices",
"gallery": "Gallery",
"contact": "Contact",
"booking": "Booking",
"from": "from",
"night": "$ / Night",
"room-facilities": "Room Facilities",
"services": "Services",
"we-are": "Services at",
"citronelles": "Citronnelles",
"choose-room": "Discover our lodges",
"hotel-facilities": "Proposed Facilities",
"latest": "Latest",
"discover": "Discover",
"our-gallery": "our Gallery",
"book-now": "Book Now",
"french": "French",
"english": "English",
"guided-tour": "Guided tour",
"room-overview": "room overview",
"select": "Select",
"rooms": "Rooms",
"relax-and-choose": "relax and choose",
"visit": "Visit",
"guests": "Guests",
"sqm": "sqm",
"send-us-message": "Send Us Message",
"please-enter-your-name": "Please enter your name.",
"please-enter-your-valid-e-mail-id": "Please enter your valid E-mail.",
"make-a": "Make a",
"address": "Address",
"your-name": "Your Name",
"your-email": "Your Email",
"please-enter-your-phone-number": "Please enter your phone number.",
"your-phone": "Your Phone",
"please-enter-your-message": "Please enter your message.",
"your-message": "Your Message",
"your-message-has-been-sent-successfully": "Your message has been sent successfully.",
"sorry-error-occured-this-time-sending-your-message": "Sorry, an error occured this time sending your message.",
"your-message-has-been-sent-successfully-refresh-this-page-if-you-want-to-send-more-messages": "Your message has been sent successfully.",
"sorry-there-was-an-error-sending-your-form": "Sorry there was an error sending your form.",
"your-reservation-has-been-sent-successfully": "Your reservation has been sent successfully.",
"send": "Send"
}
@dalton5 What is the installed version of node
on your system? For inlang to work seamlessly, we recommend v18 or above. (only vscode is running on v16)
@NilsJacobsen Can you jump in here? I don't think this is an ide extension issue.
The JSON looks correct for me but gives Unexpected end of JSON input
.
v18.12.1 is installed on the system
@dalton5 I need help seeing where the problem origins. Could you provide an open-sourced reproduction project? I know it requires some work from your side, but it helps to understand the error.
@inlang/plugins
Ok I found a new clue. I am going to check why he finds my config bad.
Ok I changed some stuff in the config and now I have this error
@dalton5 I recommend starting with the npx @inlang/cli@latest config validate
command. If that returns an error there should be either a setup problem between inlang.config.js
and your recourse files or a bug in the plugin.
While this is not solved, you don't need to look in the ide-extension.
Could you provide us with your folder structure? I'm especially interested in the nesting of your resource files.
npx @inlang/cli@latest config validate
npx @inlang/cli@latest config validate
ERROR (node:40176) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use node --trace-warnings ...
to show where the warning was created)
i 🔎 Validating the config file... 16:40:19 √ 🎉 Inlang config is valid!
My inlang config is in client folder. Not the root. Is it an issue?
@dalton5 that is the problem. The inlang.config.js
needs to be in the root. more info -> https://inlang.com/documentation/quick-start#manual-step-by-step-guide
@dalton5 and, if you want to do yourself a favor, exclude node_modules
via .gitignore
😅 you don't want to store 4k files in your repository on github.
@NiklasBuchfink can you run this repo https://github.com/dalton5/proofError on your windows machine and try to reproduce the bug?
I cloned the repo and tried it on my windows machine. Without changing the inlang.config.js
it worked, but the @inlang/sdk-js
uses the i
function and the VS Code extension only recognizes the t
function:
@felixhaeberle Do you know why this is the case?
Yes I could find the issue by putting inlang config file at the root.
But can you launch the page? if you run npm run dev and go to the page? I have an issue of multiple load.
@ivanhofer smells like we need a dedicated sveltekit sdk plugin:D
@NilsJacobsen There is one, this can be seen as the "sveltekit" SDK plugin, because we only support sveltekit for now: https://github.com/inlang/inlang/blob/242fe2f0369d79faa5f149c60f4256b13790f285/source-code/sdk-js-plugin/README.md#L13
With or without the inlangPlugin() inside the vite.config.js
, I just get a 500 error.
But it also seems that houdini
and inlangPlugin
use define both a load
function which produce conflicts inside the vite:esbuild
bundling:
Internal server error: Transform failed with 2 errors:
C:/Users/nikla/Documents/code/proofError/client/src/routes/+layout.server.ts:13:13: ERROR: Multiple exports with the same name "load"
C:/Users/nikla/Documents/code/proofError/client/src/routes/+layout.server.ts:13:13: ERROR: The symbol "load" has already been declared
Plugin: vite:esbuild
File: C:/Users/nikla/Documents/code/proofError/client/src/routes/+layout.server.ts:13:13
Multiple exports with the same name "load"
11 | }
12 |
13 | export const load = initRootLayoutServerLoadWrapper().use(() => {});
| ^
The symbol "load" has already been declared
11 | }
12 |
13 | export const load = initRootLayoutServerLoadWrapper().use(() => {});
| ^
at failureErrorWithLog (C:\Users\nikla\Documents\code\proofError\client\node_modules\esbuild\lib\main.js:1646:15)
at C:\Users\nikla\Documents\code\proofError\client\node_modules\esbuild\lib\main.js:847:29
at responseCallbacks.<computed> (C:\Users\nikla\Documents\code\proofError\client\node_modules\esbuild\lib\main.js:703:9)
at handleIncomingPacket (C:\Users\nikla\Documents\code\proofError\client\node_modules\esbuild\lib\main.js:762:9)
at Socket.readFromStdout (C:\Users\nikla\Documents\code\proofError\client\node_modules\esbuild\lib\main.js:679:7)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) (x2)
Error: Transform failed with 2 errors:
C:/Users/nikla/Documents/code/proofError/client/src/routes/+layout.server.ts:13:13: ERROR: Multiple exports with the same name "load"
C:/Users/nikla/Documents/code/proofError/client/src/routes/+layout.server.ts:13:13: ERROR: The symbol "load" has already been declared
at failureErrorWithLog (C:\Users\nikla\Documents\code\proofError\client\node_modules\esbuild\lib\main.js:1646:15)
at C:\Users\nikla\Documents\code\proofError\client\node_modules\esbuild\lib\main.js:847:29
at responseCallbacks.<computed> (C:\Users\nikla\Documents\code\proofError\client\node_modules\esbuild\lib\main.js:703:9)
at handleIncomingPacket (C:\Users\nikla\Documents\code\proofError\client\node_modules\esbuild\lib\main.js:762:9)
at Socket.readFromStdout (C:\Users\nikla\Documents\code\proofError\client\node_modules\esbuild\lib\main.js:679:7)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) {
errors: [
{
detail: undefined,
id: '',
location: [Object],
notes: [Array],
pluginName: '',
text: 'Multiple exports with the same name "load"'
},
{
detail: undefined,
id: '',
location: [Object],
notes: [Array],
pluginName: '',
text: 'The symbol "load" has already been declared'
}
],
warnings: [],
frame: '\n' +
'\x1B[33mMultiple exports with the same name "load"\x1B[39m\n' +
'11 | }\n' +
'12 | \n' +
'13 | export const load = initRootLayoutServerLoadWrapper().use(() => {});\n' +
' | ^\n' +
'\n' +
'\x1B[33mThe symbol "load" has already been declared\x1B[39m\n' +
'11 | }\n' +
'12 | \n' +
'13 | export const load = initRootLayoutServerLoadWrapper().use(() => {});\n' +
' | ^\n',
loc: {
column: 13,
file: 'C:/Users/nikla/Documents/code/proofError/client/src/routes/+layout.server.ts',
length: 4,
line: 13,
lineText: 'export const load = initRootLayoutServerLoadWrapper().use(() => {});',
namespace: '',
suggestion: ''
},
plugin: 'vite:esbuild',
id: 'C:/Users/nikla/Documents/code/proofError/client/src/routes/+layout.server.ts',
pluginCode: 'import { buildSessionObject } from "$houdini/plugins/houdini-svelte/runtime/session";\r\n' +
'import { initRootLayoutServerLoadWrapper } from "@inlang/sdk-js/adapter-sveltekit/server";\r\n' +
'\r\n' +
'export async function load(event) {\r\n' +
' const __houdini__vite__plugin__return__value__ = {};\r\n' +
'\r\n' +
' return {\r\n' +
' ...buildSessionObject(event),\r\n' +
' ...__houdini__vite__plugin__return__value__\r\n' +
' };\r\n' +
'}\r\n' +
'\r\n' +
'export const load = initRootLayoutServerLoadWrapper().use(() => {});'
}
Just for ypour information it was an issue I created some months ago here: https://github.com/inlang/inlang/issues/878
@dalton5 Let's close this issue and reopen #878, as it appears to be a duplicate. @ivanhofer, can you continue there as you have more experience in Svelte and their "Vite" bundling process?
Problem
Hi,
I can't have the extension to work. Neither tootip nor commands are working.
I have this error:
My config:
Expected behavior
It should find the command and the extension should work
Reproduction
Install the extension inlang
inlang.config.js
filenpx @inlang/cli config validate
fileOther information
Windows 11