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

localStorage is not available for opaque origins #18

Open
ilackarms opened this issue Jan 6, 2023 · 6 comments
Open

localStorage is not available for opaque origins #18

ilackarms opened this issue Jan 6, 2023 · 6 comments

Comments

@ilackarms
Copy link

Describe the bug
Cannot run a project which imports phaser-on-nodejs in dev mode.

When refreshing the page, i get the error SecurityError: localStorage is not available for opaque origins

Seems this is supposedly caused by jest and JSDOM, but none of the fixes suggested in the issues i've found have worked

@yandeu
Copy link
Member

yandeu commented Jan 6, 2023

What's the project. Is it open source?
I suggest using arcade-physics instead.

@ilackarms
Copy link
Author

was not able to et arcade-physics working with scene.physics.overlapRect

@yandeu
Copy link
Member

yandeu commented Jan 7, 2023

Support for overlap has been added 4 days ago.
See https://github.com/yandeu/arcade-physics/blob/main/test/overlap.test.js

@ilackarms
Copy link
Author

interesting. i still need the ability to read in tilemaps for collisions and object layers. is that possible with arcade-physics?

@zewa666
Copy link

zewa666 commented Jan 13, 2023

not sure if thats fully related to this but I had a bunch of similar issues. Try changing this line from the dist https://github.com/geckosio/phaser-on-nodejs/blob/master/src/index.ts#L10 to read have an URL:

-const dom = new JSDOM(`<!DOCTYPE html><body></body>`);
+const dom = new JSDOM(`<!DOCTYPE html><body></body>`, {
+  url: 'http://localhost/'
+});

@yandeu
Copy link
Member

yandeu commented Jan 18, 2023

interesting. i still need the ability to read in tilemaps for collisions and object layers. is that possible with arcade-physics?

Not yet, but I plan to implement it.

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

No branches or pull requests

3 participants