Skip to content
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

IllegalStateException: There seems to be hard coded directories from the development machine #5

Open
McPringle opened this issue Apr 14, 2023 · 11 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@McPringle
Copy link
Contributor

When I use v1.0.1 from Vaadin Addons Maven directory:

java.lang.IllegalStateException:
Running project in development mode with no access to folder
'C:\Users\juergen\IdeaProjects\vaadin-trix-editor'.

Crazy error message when running on macOS... :-)

@jhoffmann99
Copy link
Owner

Thanks for mentioning this bug. I will have a look at it tomorrow.

If you have the time and want to contribute feel free to open a pull request to fix this behavior.

Thx, Jürgen

@jhoffmann99 jhoffmann99 added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Apr 14, 2023
@jhoffmann99
Copy link
Owner

@McPringle After adding maven wrapper to the project does this solve your issue on macOS?

@McPringle
Copy link
Contributor Author

I'm still investigating. I use Maven Wrapper all the time to make sure, that my projects have a reproducible build on every machine. Especially when working with open-source projects, where it is very likely that every developer has a different version of Maven installed.

@jhoffmann99
Copy link
Owner

I guess I've found the issue. The file "flow-build-info.json" containing my local machine paths should'nt be included in the production build. Inside pom.xml it's marked for exclusion however its still inside the target folder.

@McPringle
Copy link
Contributor Author

When I build a version on my own, I get the same error message but with my home folder. But my home folder obviously exists on my machines, so the message is a little bit more descriptive now:

On macOS

Failed to find the following css files in the `node_modules` or `/Users/McPringle/GitHub/vaadin-trix-editor/frontend` directory tree:
  - ./themes/komunumo/views/website/website-layout.css
  - ...

On Windows

Failed to find the following css files in the `node_modules` or `C:\Users\McPringle\GitHub\vaadin-trix-editor\frontend` directory tree:
  - ./themes/komunumo/views/website/website-layout.css
  - ...

Somehow when building Vaadin Trix Editor, the source path of the build system finds its way into the distribution file and causes problems loading CSS files in the project, that uses the Vaadin Trix Editor. As you can see, I tried it on Windows and macOS.

@McPringle
Copy link
Contributor Author

Kind of "works on my machine"... lol

@McPringle
Copy link
Contributor Author

McPringle commented Apr 15, 2023

It might have to do with Vaadins development mode vs. production mode. When I do build in development mode, it will succeed: ./mvnw clean package

When I do a build in production mode, it will fail: ./mvnw clean package -Pproduction

[INFO] Running Vite ...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  24.076 s
[INFO] Finished at: 2023-04-15T14:38:51+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:23.3.6:build-frontend (default) on project trix-editor: Execution default of goal com.vaadin:vaadin-maven-plugin:23.3.6:build-frontend failed: Vite process exited with non-zero exit code.
[ERROR] Stderr: 'vite v3.2.5 building for production...
[ERROR] transforming...
[ERROR] ✓ 13 modules transformed.
[ERROR] [vite]: Rollup failed to resolve import "@vaadin/vaadin-themable-mixin" from "target/frontend/generated-flow-imports-fallback.js".
[ERROR] This is most likely unintended because it can break your application at runtime.
[ERROR] If you do want to externalize this module explicitly add it to
[ERROR] `build.rollupOptions.external`
[ERROR] error during build:
[ERROR] Error: [vite]: Rollup failed to resolve import "@vaadin/vaadin-themable-mixin" from "target/frontend/generated-flow-imports-fallback.js".
[ERROR] This is most likely unintended because it can break your application at runtime.
[ERROR] If you do want to externalize this module explicitly add it to
[ERROR] `build.rollupOptions.external`

Did you do the release build in production mode?

@jhoffmann99
Copy link
Owner

Doing a production build with ./mvnw clean package -Pproduction fails on my side as well :/

@McPringle
Copy link
Contributor Author

It looks like (I'm not sure) that you by accident created a release build in development mode which made your development directories part of the released JAR file. That's why my development directory is part of the JAR file of my test, too. Because I did a ./mvnw clean install only which defaults to development mode.

@jhoffmann99
Copy link
Owner

Do we really need the production profile here?

@McPringle
Copy link
Contributor Author

McPringle commented Apr 19, 2023

My idea was that the development profile might be the reason why the JSON file containing the path to the local development folder was part of the deployment. But I have to add that I never created a stand-alone Vaadin component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants