superflare icon indicating copy to clipboard operation
superflare copied to clipboard

"[mf:err] GET /: InvalidCharacterError: Invalid character" - npx superflare@latest new

Open tsteckenborn opened this issue 1 year ago • 3 comments

Running npx superflare@latest new -> Database Models, Scheduled Tasks-> npm install --legacy-peer-deps-> npx superflare migrate -> npm run dev or npx superflare dev yields the following error on opening the index URL right now:

[mf:err] GET /: InvalidCharacterError: Invalid character
    at atob (.../node_modules/@miniflare/core/src/standards/encoding.ts:33:13)
    at unsign (.../node_modules/@remix-run/cloudflare/dist/crypto.js:29:42)
    at decodeCookieValue (.../node_modules/@remix-run/server-runtime/dist/cookies.js:82:27)
    at Object.parse (.../node_modules/@remix-run/server-runtime/dist/cookies.js:54:60)
    at Object.getSession (.../node_modules/@remix-run/server-runtime/dist/sessions/cookieStorage.js:36:54)
    at handleFetch2 (.../node_modules/@superflare/remix/dist/index.mjs:23:5)
    at ServiceWorkerGlobalScope.[kDispatchFetch] (.../node_modules/@miniflare/core/src/standards/event.ts:385:13)
    at Server.<anonymous> (.../node_modules/@miniflare/http-server/src/index.ts:291:20)

tsteckenborn avatar Apr 30 '23 12:04 tsteckenborn

I am facing the same issue, not able to get it to load.

subhendukundu avatar Apr 30 '23 15:04 subhendukundu

🤔 I've seen this sometimes too, and it's usually when the APP_KEY is not set properly in .dev.vars.

Can you confirm you have that value set? It's definitely not a super valuable error message coming from Remix/Miniflare.

jplhomer avatar Apr 30 '23 23:04 jplhomer

The APP_KEY is defined in the .dev.vars, yet that must have happened through npx superflare@latest new. Yet without the worker itself being pushed by that, I don't exactly know how I could check against the eventual corresponding secret it should be according to https://superflare.dev/deploying#checklist. npx wrangler secret list -jdoesn't work for me, as it seems to be still looking for the toml (Required Worker name missing. Please specify the Worker name in wrangler.toml, or pass it as an argument with --name <worker-name>), npx wrangler secret list --name my-app-name errors with workers.api.error.script_not_found [code: 10007].

Right now I'd assume that the secret therefor isn't set. Yet I'm confused as the only reference to APP_KEY is in the deployment docs.

It might make sense to add the additional steps necessary to:

https://github.com/jplhomer/superflare/blob/919e4dcc4c6e195f3998af0848c5fdc0c43b4afa/packages/superflare/docs/getting-started.md?plain=1#L6-L22

and

https://github.com/jplhomer/superflare/blob/919e4dcc4c6e195f3998af0848c5fdc0c43b4afa/packages/superflare/cli/new.ts#L295-L298

tsteckenborn avatar May 01 '23 09:05 tsteckenborn