aleph.js icon indicating copy to clipboard operation
aleph.js copied to clipboard

"Get Started" instructions are broken

Open vincent-olivert-riera opened this issue 4 years ago • 24 comments
trafficstars

I just tried to do exactly what the instructions from https://alephjs.org/docs/get-started say:

deno install --unstable -A -f -n aleph https://deno.land/x/[email protected]/cli.ts
aleph init hello
cd hello
aleph dev

But that resulted on this error:

error: Uncaught (in promise) TypeError: Cannot set property navigator of #<Window> which has only a getter
        Object.assign(globalThis, {
               ^
    at Function.assign (<anonymous>)
    at Project._init (https://deno.land/x/[email protected]/project.ts:600:16)
    at async https://deno.land/x/[email protected]/project.ts:106:13
    at async start (https://deno.land/x/[email protected]/server.ts:12:5)

vincent-olivert-riera avatar Mar 13 '21 12:03 vincent-olivert-riera

I got the same error.

Also happens in the newest version:

Check https://deno.land/x/[email protected]/cli/dev.ts
error: Uncaught (in promise) TypeError: Cannot set property navigator of #<Window> which has only a getter
    Object.assign(globalThis, {
           ^
    at Function.assign (<anonymous>)
    at Application.init (https://deno.land/x/[email protected]/server/app.ts:410:12)
    at async serve (https://deno.land/x/[email protected]/server/server.ts:177:3)
    at async default (https://deno.land/x/[email protected]/cli/dev.ts:21:3)
    at async main (https://deno.land/x/[email protected]/cli.ts:147:7)

RazerMoon avatar Mar 13 '21 14:03 RazerMoon

This is related to Deno 1.8.0. Downgrade Deno to 1.7.5 to run the app

borsemayur2 avatar Mar 13 '21 16:03 borsemayur2

I just tried to do exactly what the instructions from https://alephjs.org/docs/get-started say:

deno install --unstable -A -f -n aleph https://deno.land/x/[email protected]/cli.ts
aleph init hello
cd hello
aleph dev

But that resulted on this error:

error: Uncaught (in promise) TypeError: Cannot set property navigator of #<Window> which has only a getter
        Object.assign(globalThis, {
               ^
    at Function.assign (<anonymous>)
    at Project._init (https://deno.land/x/[email protected]/project.ts:600:16)
    at async https://deno.land/x/[email protected]/project.ts:106:13
    at async start (https://deno.land/x/[email protected]/server.ts:12:5)

Use aleph version v0.3.0-alpha.8 instead of v0.2.28 like: deno install --unstable -A -f -n aleph https://deno.land/x/[email protected]/cli.ts

borsemayur2 avatar Mar 13 '21 16:03 borsemayur2

@vincent-olivert-riera @RazerMoon @borsemayur2 i'm so sorry, currently you should use v0.2.28 + deno 1.6.3, the alpha versions is super unstable...the next patch (beta.1) i'm working on it should be more stable! PR: https://github.com/alephjs/aleph.js/pull/176

ije avatar Mar 13 '21 16:03 ije

I have just recently run into an issue running Aleph JS using the cli for an existing project (and a newly created project to sanity check) on OSX, 11.2.1 (Big Sur)

aleph --version image

deno --version image

When I run aleph dev in a brand new project I get image

mellisdesigns avatar Mar 13 '21 21:03 mellisdesigns

I am trying to get started with aleph, and follow the advice here. My goal is to put all the version-lockin stuff in a Makefile, so we have a known-working combo of versions of things, that is reproducible on every machine.

I use docker to lock-in versions:

docker run -v ${PWD}:/app --workdir=/app -it --init hayd/alpine-deno:1.6.3 deno run --unstable -A https://deno.land/x/[email protected]/cli.ts --version

aleph.js 0.2.28
deno 1.6.3
v8 8.8.294
typescript 4.1.3

docker run -v ${PWD}:/app --workdir=/app -it --init hayd/alpine-deno:1.6.3 deno run --unstable -A https://deno.land/x/[email protected]/cli.ts init testapp

INFO Aleph.js is ready to Go.
INFO $ cd testapp
INFO $ aleph dev    # start the app in `development` mode
INFO $ aleph start  # start the app in `production` mode
INFO $ aleph build  # build the app to a static site (SSG)

docker run -v ${PWD}:/app --workdir=/app -it --init hayd/alpine-deno:1.6.3 deno run --unstable -A https://deno.land/x/[email protected]/cli.ts dev /app/testapp

error: Uncaught (in promise) NotFound: No such file or directory (os error 2)
    at processResponse (deno:core/core.js:223:11)
    at Object.jsonOpAsync (deno:core/core.js:240:12)
    at async open (deno:runtime/js/30_files.js:44:17)
    at async Object.readFile (deno:runtime/js/40_read_file.js:15:18)
    at async Project._compile (project.ts:1022:29)
    at async Project._compile (project.ts:1172:28)
    at async Project._init (project.ts:658:21)
    at async project.ts:106:13
    at async start (server.ts:12:5)

Same with dev testapp.

I also tried this, inside the dir it initted before:

docker run -v ${PWD}:/app --workdir=/app -it --init hayd/alpine-deno:1.6.3 sh
deno install --unstable -A -f -n aleph https://deno.land/x/[email protected]/cli.ts
/usr/local/bin/aleph --version

aleph.js 0.2.28
deno 1.6.3
v8 8.8.294
typescript 4.1.3

/usr/local/bin/aleph dev

And I get same error. Am I missing some other part?

konsumer avatar Mar 16 '21 21:03 konsumer

@mellisdesigns Your error is due to problems in esm.sh, please try again and if it doesn't work open an issue in the esm.sh repo

shadowtime2000 avatar Mar 16 '21 21:03 shadowtime2000

My issue seems like #195 so maybe that is a better place to track it. I originally had the error of OP, but locking in versions caused that.

konsumer avatar Mar 16 '21 21:03 konsumer

I have the same issue

aleph.js 0.2.28
deno 1.8.1
v8 9.0.257.3
typescript 4.2.2

With this error

error: Uncaught (in promise) TypeError: Cannot set property navigator of #<Window> which has only a getter
        Object.assign(globalThis, {
               ^
    at Function.assign (<anonymous>)
    at Project._init (https://deno.land/x/[email protected]/project.ts:600:16)
    at async https://deno.land/x/[email protected]/project.ts:106:13
    at async start (https://deno.land/x/[email protected]/server.ts:12:5)

macorifice avatar Mar 18 '21 00:03 macorifice

@macorifice Try downgrading to Deno 1.6.3 for that.

shadowtime2000 avatar Mar 18 '21 00:03 shadowtime2000

➜ aleph --version
aleph.js 0.2.28
deno 1.6.3
v8 8.8.294
typescript 4.1.3

image

macorifice avatar Mar 18 '21 08:03 macorifice

@macorifice same as me. I think it's tracked in #195

konsumer avatar Mar 18 '21 09:03 konsumer

#195

I think it's a little bit different cuz in your case the server started, in my case, it didn't found any files or directories

macorifice avatar Mar 18 '21 10:03 macorifice

@macorifice Not sure what you mean. I got same error, and it also didn't start. I just gave detailed instructions to test with docker with the suggested versions.

konsumer avatar Mar 18 '21 10:03 konsumer

@konsumer you're right! I only saw the first part of 195 and saw the server started, then I realized that you are referring to the continuation

macorifice avatar Mar 18 '21 10:03 macorifice

hey guys, I'm getting following error using aleph.js 0.3.0-alpha.22: os error 123 "The filename, directory name, or volume label syntax is incorrect", also tried using deno: 1.8.2 -> same error, OS= Win10, I also followed the docs, (deno:1.6.3 and alpeh v0.2.28) didn't seem to work either -> same error as described in the first comment. Any help would be greatly appreciated. image

arctix-tk avatar Apr 02 '21 22:04 arctix-tk

hey guys, I'm getting following error using aleph.js 0.3.0-alpha.22: os error 123 "The filename, directory name, or volume label syntax is incorrect", also tried using deno: 1.8.2 -> same error, OS= Win10, I also followed the docs, (deno:1.6.3 and alpeh v0.2.28) didn't seem to work either -> same error as described in the first comment. Any help would be greatly appreciated. image

I'm getting the same error with both (alpha.22 and alpha.24) on Win10. But Able to run the app in WSL2. The Error seems to be related with Deno runtime API.

borsemayur2 avatar Apr 03 '21 01:04 borsemayur2

@borsemayur2 @arctix-tk The error you are experiencing is #201.

shadowtime2000 avatar Apr 03 '21 01:04 shadowtime2000

You all guys don't you need downgrade Deno. Just upgrade Deno v1.9.2 it worked. Previously I using Deno v1.6.3 and I got the same error since upgrading deno it work well now.

gauravnumber avatar May 01 '21 12:05 gauravnumber

@gauravnumber I got it to run init, but it failed to run dev. What versions of things are you using?

Here is my test procedure:

docker run -v ${PWD}:/app --workdir=/app -it --init hayd/alpine-deno:1.9.2 deno run --unstable -A https://deno.land/x/[email protected]/cli.ts --version

aleph.js 0.2.28
deno 1.9.2
v8 9.1.269.5
typescript 4.2.2

# works ok now:
docker run -v ${PWD}:/app --workdir=/app -it --init hayd/alpine-deno:1.9.2 deno run --unstable -A https://deno.land/x/[email protected]/cli.ts init testapp

# lots of errors:
docker run -v ${PWD}:/app --workdir=/app/testrun -it --init hayd/alpine-deno:1.9.2 run --unstable -A https://deno.land/x/[email protected]/cli.ts dev

I get this error:

error: Uncaught (in promise) TypeError: TS2345 [ERROR]: Argument of type 'TransformerFactory<SourceFile>' is not assignable to parameter of type 'TransformerFactory<SourceFile> | CustomTransformerFactory'.
  Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").TransformerFactory<import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").SourceFile>' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").TransformerFactory<import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").SourceFile>'.
    Types of parameters 'context' and 'context' are incompatible.
      Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").TransformationContext' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").TransformationContext'.
        The types of 'factory.createTypeParameterDeclaration(...).parent' are incompatible between these types.
          Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").DeclarationWithTypeParameterChildren | import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").InferTypeNode' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").DeclarationWithTypeParameterChildren | import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").InferTypeNode'.
            Type 'JSDocTemplateTag' is not assignable to type 'DeclarationWithTypeParameterChildren | InferTypeNode'.
              Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDocTemplateTag' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDocTemplateTag'.
                Types of property 'parent' are incompatible.
                  Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDoc | import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDocTypeLiteral' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDoc | import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDocTypeLiteral'.
                    Type 'JSDoc' is not assignable to type 'JSDoc | JSDocTypeLiteral'.
                      Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDoc' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDoc'.
                        Types of property 'parent' are incompatible.
                          Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").HasJSDoc' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").HasJSDoc'.
                            Type 'ImportEqualsDeclaration' is not assignable to type 'HasJSDoc'.
                              Property 'isTypeOnly' is missing in type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").ImportEqualsDeclaration' but required in type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").ImportEqualsDeclaration'.
    if (reactRefresh) transformers.before!.push(reactRefreshTS())
                                                ~~~~~~~~~~~~~~~~
    at https://deno.land/x/[email protected]/tsc/compile.ts:28:49

    'isTypeOnly' is declared here.
            readonly isTypeOnly: boolean;
                     ~~~~~~~~~~
        at https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts:1601:18
    const { default: cmd } = await import(`./cli/${command}.ts`)
                             ^
    at async main (https://deno.land/x/[email protected]/cli.ts:163:30)

konsumer avatar May 02 '21 00:05 konsumer

You may need upgrade Aleph.js. Try this

docker run -v ${PWD}:/app --workdir=/app/testrun -it --init hayd/alpine-deno:1.9.2 run --unstable -A https://deno.land/x/[email protected]/cli.ts dev

gauravnumber avatar May 02 '21 04:05 gauravnumber

@gauravnumber That is using latest stable, but I'm fine with alpha, too, though. This does seem to start:

docker run -p 8080:8080 -v ${PWD}:/app --workdir=/app/testrun -it --init hayd/alpine-deno:1.9.2 run --unstable -A https://deno.land/x/[email protected]/cli.ts dev

... download stuff...

INFO Compiling...
INFO Start watching code changes...
INFO Server ready on http://localhost:8080/

also leaving out --init, neither serves anything on port 8080, though. Am I missing something else? Did you test this?

konsumer avatar May 02 '21 05:05 konsumer

Huh, nevermind, maybe it is working. The --init flag seemed lock up my terminal on mac, so I killed the docker daemon, and restarted, and ran the same command again. It did seem to get further. I get "Page Not Found", but maybe that is expected? It appears to at least be servicing the error.

konsumer avatar May 02 '21 05:05 konsumer

Still broken for me

aleph.js 0.3.0-alpha.8
deno 1.22.0
v8 10.0.139.17
typescript 4.6.2

slashwhatever avatar Jun 23 '22 11:06 slashwhatever