You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my current setup, I use symlinks for a vaadin project located on another drive.
Examle:
C:\Dev\VaadinProject -> The real project
D:\Dev\VaadinProject -> The symlink
In IntelliJ, I am using the symlink project located under D:\Dev\VaadinProject.
This setup worked fine until we updated to Vaadin 23 and started using Vite but now I get the following error: com.vaadin.flow.server.ServiceException: java.net.ConnectException: Connection refused: no further information
It seems like the vite server started but stopped after an error, which is printed to the console:
TypeError: Cannot read properties of undefined (reading 'imports')
at runOptimizeDeps (file:///C:/Dev/VaadinProject/node_modules/vite/dist/node/chunks/dep-665b0112.js:42330:89)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
After some debugging, I found that a resource should be loaded from D:\Dev\VaadinProject\fakt\node_modules and that does not seem to be allowed (missing in server.fs.allow).
The allowed folders come from the vite.generated.ts and are the following:
As you see, only frontend is allowed to be loaded from D:\, all other folders need to be loaded using C:\.
The reason for this seems to be, that __dirname, which is used to calculate the paths, already resolves the symlink (see nodejs/node#22602).
The first allowed path (frontendFolder) comes from settings.frontendFolder and is an absolute path, using D:\,
The other 3 are relativ paths (addonFrontendFolder from vaadin-dev-server-settings.json is target/flow-frontend) and are resolved using __dirname and therefor use the wrong path.
Minimal reproducible example
Download a new vaadin starter project
Create a symlink for it (on windows 10 use powershell and following command: ni D:\Dev\VaadinProject-i SymbolicLink -ta C:\Dev\VaadinProject\
Start the project and open the browser
After the front-end is build, you get an error page instead of the application page.
Expected behavior
The application should start normaly.
Actual behavior
An error is shown
Versions:
- Vaadin / Flow version: 23.2.7
- Java version: Java 17.0.4
- OS version: Windows 10
- IDE (if applicable): IntelliJ Idea
- Development or production mode: Development mode
The text was updated successfully, but these errors were encountered:
Yes that seems to work.
I had to add all folders with C:\ and D:\ and start the server. After that it seems to be enough to allow all folders for D:\.
Might have been some caching problem...
Unfortunately this is not a solution, as there are multiple people working on this project and others might use different folder structure.
then all the entries of server.fs.allow point to the real project directory (test-proj) and all resources are also loaded from there so everything works.
Description of the bug
In my current setup, I use symlinks for a vaadin project located on another drive.
Examle:
C:\Dev\VaadinProject -> The real project
D:\Dev\VaadinProject -> The symlink
In IntelliJ, I am using the symlink project located under D:\Dev\VaadinProject.
This setup worked fine until we updated to Vaadin 23 and started using Vite but now I get the following error:
com.vaadin.flow.server.ServiceException: java.net.ConnectException: Connection refused: no further information
It seems like the vite server started but stopped after an error, which is printed to the console:
After some debugging, I found that a resource should be loaded from
D:\Dev\VaadinProject\fakt\node_modules
and that does not seem to be allowed (missing inserver.fs.allow
).The allowed folders come from the
vite.generated.ts
and are the following:As you see, only
frontend
is allowed to be loaded fromD:\
, all other folders need to be loaded usingC:\
.The reason for this seems to be, that
__dirname
, which is used to calculate the paths, already resolves the symlink (see nodejs/node#22602).The first allowed path (
frontendFolder
) comes fromsettings.frontendFolder
and is an absolute path, usingD:\
,The other 3 are relativ paths (
addonFrontendFolder
fromvaadin-dev-server-settings.json
istarget/flow-frontend
) and are resolved using__dirname
and therefor use the wrong path.Minimal reproducible example
ni D:\Dev\VaadinProject-i SymbolicLink -ta C:\Dev\VaadinProject\
After the front-end is build, you get an error page instead of the application page.
Expected behavior
The application should start normaly.
Actual behavior
An error is shown
Versions:
The text was updated successfully, but these errors were encountered: