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

Cypress does not load JS make acceptance-test #122

Open
stevepiercy opened this issue Dec 9, 2024 · 4 comments · May be fixed by #123
Open

Cypress does not load JS make acceptance-test #122

stevepiercy opened this issue Dec 9, 2024 · 4 comments · May be fixed by #123
Assignees

Comments

@stevepiercy
Copy link
Contributor

When running Cypress with make acceptance-test, a couple of .js files do not load and the Volto home page appears unstyled.

Both @sneridagh and I tested this. He had no problem, but I did. He also mentioned that @reebalazs had a similar problem.

We checked my /etc/hosts, which were essentially the same.

127.0.0.1       localhost
255.255.255.255      broadcasthost
::1             localhost

We resolved it by replacing this line in frontend/Makefile under acceptance-frontend-dev-start:

	RAZZLE_API_PATH=http://127.0.0.1:55001/plone pnpm start

With this line:

	RAZZLE_API_PATH=http://127.0.0.1:55001/plone NODE_OPTIONS=--dns-result-order=ipv4first pnpm start

PR incoming.

@davisagli
Copy link
Member

@stevepiercy @sneridagh The Volto server already sets this as the very first thing before it starts the server: https://github.com/plone/volto/blob/main/packages/volto/src/start-server.js#L10

So, I don't understand why/how this option helps.

Which version of Node are you using?

@stevepiercy
Copy link
Contributor Author

@davisagli OK, I see that in project-title/frontend/core/packages/volto/src/start-server.js. But for whatever reason unknown to both of us, the environment variable option was necessary to get the .js to load. Without that option, I got the unstyled version. I can reproduce it without that environment variable, if you want me to try more troubleshooting. Maybe @reebalazs has an idea, too?

$ node --version
v20.10.0

I'm fine with changing the version, too.

Please let me know. Thank you!

@davisagli
Copy link
Member

davisagli commented Dec 9, 2024

@stevepiercy What URL did you load in your browser (or equivalently, what URL did Cypress load)? And can you check the browser dev tools and see what is the URL of the stylesheet that failed to load?

@stevepiercy
Copy link
Contributor Author

lol, and now it loads just fine without that env var. I opened a new terminal session to ensure I didn't have it set.

So once more, I ran through the process I documented in https://github.com/plone/documentation/pull/1812/files. The issue returns. Very interesting. Maybe my process is not correct?

Here's the result.

URL:
http://localhost:3000/__/#/specs/runner?file=../../../cypress/tests/example.cy.js

Screenshot 2024-12-09 at 1 50 00 PM

These two files don't load. Why are they on a different port?

Screenshot 2024-12-09 at 1 51 13 PM

All CSS files load with a 304 response.

Screenshot 2024-12-09 at 1 56 48 PM

What more do we need to figure this out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants