jsonhero-web icon indicating copy to clipboard operation
jsonhero-web copied to clipboard

Bug: Crash when change to dark mode / dark theme

Open ChowRex opened this issue 3 years ago • 4 comments

Envirorment:

Hardware

Apple MacBook Pro with M1 Pro chip.

Software

MacOS 12.4

npm test


> test
> jest

 PASS  tests/formatStarCount.test.ts
 PASS  tests/search.test.ts
 PASS  tests/stableJson.test.ts
 PASS  tests/relatedValues.test.ts
  ● Console

    console.log
      [
        { value: '1609937654', paths: [ '$.data.0.modifiedAt' ] },
        { value: 'null', paths: [ '$.data.1.modifiedAt' ] },
        { value: 'undefined', paths: [ '$.data.2.modifiedAt' ] }
      ]

      at Object.<anonymous> (tests/relatedValues.test.ts:174:13)

 PASS  tests/jsonColumnView.test.ts

Test Suites: 5 passed, 5 total
Tests:       14 passed, 14 total
Snapshots:   11 passed, 11 total
Time:        2.858 s
Ran all test suites.

npm --version

8.11.0

node -v

v18.3.0

Description

When I deployed this project on my own computer and try to switch from the light theme to the dark theme, then there will an error returned.

image

And here is the error log.


[1] TypeError: Value of "this" must be of type SubtleCrypto
[1]     at new NodeError (node:internal/errors:377:5)
[1]     at Proxy.importKey (node:internal/crypto/webcrypto:517:30)
[1]     at sign22 (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/cloudflare-workers/esm/cookieSigning.js:13:33)
[1]     at encodeCookieValue (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/cookies.js:71:21)
[1]     at Object.serialize (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/cookies.js:50:56)
[1]     at Object.commitSession (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/sessions/cookieStorage.js:36:21)
[1]     at Object.commit (/Users/user/Documents/gits/github/jsonhero-web/app/theme.server.ts:30:32)
[1]     at action5 (/Users/user/Documents/gits/github/jsonhero-web/build/route:/Users/user/Documents/gits/github/jsonhero-web/app/routes/actions/setTheme.ts:31:51)
[1]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[1]     at callRouteAction (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/data.js:32:14) {
[1]   code: 'ERR_INVALID_THIS'
[1] }
[1] POST /actions/setTheme?_data=routes%2Factions%2FsetTheme 500 Internal Server Error (598.38ms, waitUntil: 598.39ms)

ChowRex avatar Jun 05 '22 08:06 ChowRex

Hmm, this issue should be been fixed by https://github.com/jsonhero-io/jsonhero-web/commit/a4b7a38e67e29ce1866552e5a078d8e1230e9a6d, can you run an npm ls miniflare in the terminal and let me know what it says? You could also try doing rm -rf node_modules and then npm install and then restart the server to see if that fixes it.

ericallam avatar Jun 07 '22 12:06 ericallam

Hmm, this issue should be been fixed by a4b7a38, can you run an npm ls miniflare in the terminal and let me know what it says? You could also try doing rm -rf node_modules and then npm install and then restart the server to see if that fixes it.

npm ls miniflare

Result: [email protected]

image

I had executed git pull then rm -rf node_modules && npm install, but it still doesn't work.

ChowRex avatar Jun 08 '22 02:06 ChowRex

same problem here

agungsantoso avatar Sep 14 '22 01:09 agungsantoso

@ChowRex how can i reproduce this issue??

chandra1899 avatar Jul 31 '23 06:07 chandra1899