phaser-on-nodejs
phaser-on-nodejs copied to clipboard
localStorage is not available for opaque origins
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
What's the project. Is it open source?
I suggest using arcade-physics
instead.
was not able to et arcade-physics working with scene.physics.overlapRect
Support for overlap has been added 4 days ago. See https://github.com/yandeu/arcade-physics/blob/main/test/overlap.test.js
interesting. i still need the ability to read in tilemaps for collisions and object layers. is that possible with arcade-physics?
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/'
+});
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.