saur icon indicating copy to clipboard operation
saur copied to clipboard

Error while trying to go though docs

Open About7Sharks opened this issue 5 years ago • 7 comments

saur new my-first-app
Application 'my-first-app' failed to create: NotFound: No such file or directory (os error 2) at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11) at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10) at async Object.open ($deno$/files.ts:37:15) at async Object.readFile ($deno$/read_file.ts:13:16) at async New (https://deno.land/x/saur/cli/new.js:24:17)

About7Sharks avatar May 12 '20 03:05 About7Sharks

Same issue here. It seems that ${root}/generate/templates/application.js does not exist.

I installed deno through Homebrew on OSX 10.15.4 (deno 0.42.0, v8 8.2.308, typescript 3.8.3) I am running the commands from zsh 5.5.1

fmquaglia avatar May 13 '20 19:05 fmquaglia

Hm. I wrote up a whole email responding yesterday and apparently it didn't send. Thanks a lot, Edison.

Anyway, I believe I have this resolved from the framework end of things. Saur now has its own loader module which pulls down these resources from a URL rather than trying to pull them locally. Apparently, Deno doesn't carry any of the static assets referenced in your JS files when you import them, so you basically have to reinvent the wheel and fetch/parse the resource yourself.

So now that you can actually generate a Saur app, you'll notice a strange issue that prevents you from actually doing anything:

error: Uncaught TypeError: Cannot resolve extension for "https://raw.githubusercontent.com/jshttp/mime-db/master/db.json" with mediaType "Json".
    at getExtension ($deno$/compiler.ts:218:13)
    at new SourceFile ($deno$/compiler.ts:263:22)
    at Function.addToCache ($deno$/compiler.ts:339:16)
    at processImports ($deno$/compiler.ts:743:31)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)

From what I can tell, it looks like this is a problem with one of the underlying libraries, either Oak or something else requiring the media-types package. Deno v1.0.0 no longer allows JSON imports. So right now, generating an app will give you a lovely directory structure but since bin/server fails to install, it won't work. Once the other libraries update, things should work again.

Apologies for the delay, and thank you so much for your feedback!

edit: I think the lack of backtrace here is an actual Deno bug. Reported as denoland/deno#5419

tubbo avatar May 14 '20 21:05 tubbo

This is almost done. Still working on the CLI not being able to install due to this error:

Download https://deno.land/x/saur/cli.js
Download https://deno.land/std/flags/mod.ts
Download https://deno.land/std/fs/read_json.ts
Download https://deno.land/x/saur/cli/new.js
Download https://deno.land/x/saur/cli/generate.js
Download https://deno.land/x/saur/cli/help.js
Download https://deno.land/x/saur/cli/run.js
Download https://deno.land/x/saur/cli/server.js
Download https://deno.land/x/saur/cli/upgrade.js
Download https://deno.land/x/saur/cli/migrate.js
Download https://deno.land/x/saur/loader.js
Download https://deno.land/std/path/mod.ts
Download https://denopkg.com/tubbo/dejs@fuck-you-github/mod.ts
Download https://deno.land/x/saur/task.js
Download https://deno.land/std/fs/walk.ts
Warning Implicitly using master branch https://deno.land/std/fs/read_json.ts
Download https://deno.land/x/saur/cli/generate/model.js
Download https://deno.land/x/saur/cli/generate/controller.js
Download https://deno.land/x/saur/cli/generate/view.js
Download https://deno.land/x/saur/cli/generate/template.js
Download https://deno.land/x/saur/cli/generate/component.js
Download https://deno.land/x/case/pascalCase.ts
Download https://deno.land/std/fs/exists.ts
Compile https://deno.land/std/fs/read_json.ts
Warning Implicitly using master branch https://deno.land/std/flags/mod.ts
Warning Implicitly using master branch https://deno.land/std/path/mod.ts
Warning Implicitly using master branch https://deno.land/std/fs/walk.ts
Warning Implicitly using master branch https://deno.land/std/fs/exists.ts
Download https://raw.githubusercontent.com/tubbo/dejs/fuck-you-github/mod.ts
Download https://deno.land/x/saur/cli/assets.js
Download https://deno.land/x/case/mod.ts
Download https://deno.land/std/encoding/utf8.ts
Download https://deno.land/x/saur/loader/asset.js
Compile https://deno.land/std/flags/mod.ts
Download https://deno.land/std/testing/asserts.ts
Warning Implicitly using master branch https://deno.land/std/encoding/utf8.ts
Warning Implicitly using master branch https://deno.land/std/testing/asserts.ts
Download https://deno.land/std/fmt/colors.ts
Download https://deno.land/std/testing/diff.ts
Warning Implicitly using master branch https://deno.land/std/fmt/colors.ts
Warning Implicitly using master branch https://deno.land/std/testing/diff.ts
Download https://deno.land/std/fs/mod.ts
Download https://deno.land/x/saur/cli/generate/migration.js
Download https://deno.land/x/saur/cli/generate/test.js
Compile https://deno.land/std/path/mod.ts
Download https://deno.land/std/path/win32.ts
Download https://deno.land/std/path/posix.ts
Download https://deno.land/std/path/common.ts
Download https://deno.land/std/path/separator.ts
Download https://deno.land/std/path/interface.ts
Download https://deno.land/std/path/glob.ts
Warning Implicitly using master branch https://deno.land/std/fs/mod.ts
Warning Implicitly using master branch https://deno.land/std/path/common.ts
Warning Implicitly using master branch https://deno.land/std/path/posix.ts
Warning Implicitly using master branch https://deno.land/std/path/win32.ts
Warning Implicitly using master branch https://deno.land/std/path/separator.ts
Warning Implicitly using master branch https://deno.land/std/path/interface.ts
Warning Implicitly using master branch https://deno.land/std/path/glob.ts
Download https://deno.land/std/path/_constants.ts
Download https://deno.land/std/path/_util.ts
Warning Implicitly using master branch https://deno.land/std/path/_constants.ts
Warning Implicitly using master branch https://deno.land/std/path/_util.ts
Download https://deno.land/std/path/_globrex.ts
Warning Implicitly using master branch https://deno.land/std/path/_globrex.ts
Compile https://deno.land/x/case/pascalCase.ts
Download https://deno.land/x/case/camelCase.ts
Download https://deno.land/x/case/upperFirstCase.ts
Download https://deno.land/x/case/upperCase.ts
Download https://deno.land/x/case/normalCase.ts
Download https://deno.land/x/case/types.ts
Download https://deno.land/x/case/lowerCase.ts
Download https://deno.land/x/case/vendor/nonWordRegexp.ts
Download https://deno.land/x/case/vendor/camelCaseRegexp.ts
Download https://deno.land/x/case/vendor/camelCaseUpperRegexp.ts
Compile https://deno.land/std/fs/walk.ts
Compile https://deno.land/std/fs/exists.ts
Compile https://raw.githubusercontent.com/tubbo/dejs/fuck-you-github/mod.ts
Download https://raw.githubusercontent.com/tubbo/dejs/fuck-you-github/mod.ts
Download https://deno.land/std/io/util.ts
Download https://deno.land/std/io/bufio.ts
Download https://deno.land/x/lodash/escape.js
Warning Implicitly using master branch https://deno.land/std/io/util.ts
Warning Implicitly using master branch https://deno.land/std/io/bufio.ts
Compile https://deno.land/x/case/mod.ts
Download https://deno.land/x/saur/loader/processor.js
Download https://deno.land/x/case/constantCase.ts
Download https://deno.land/x/case/dotCase.ts
Download https://deno.land/x/case/headerCase.ts
Download https://deno.land/x/case/lowerFirstCase.ts
Download https://deno.land/x/case/paramCase.ts
Download https://deno.land/x/case/pathCase.ts
Download https://deno.land/x/case/sentenceCase.ts
Download https://deno.land/x/case/snakeCase.ts
Download https://deno.land/x/case/swapCase.ts
Download https://deno.land/x/case/titleCase.ts
Download https://deno.land/x/checksum/mod.ts
Compile https://deno.land/std/fs/mod.ts
Download https://deno.land/std/fs/empty_dir.ts
Download https://deno.land/std/fs/ensure_dir.ts
Download https://deno.land/std/fs/ensure_file.ts
Download https://deno.land/std/fs/ensure_link.ts
Download https://deno.land/std/fs/ensure_symlink.ts
Download https://deno.land/std/fs/expand_glob.ts
Download https://deno.land/std/fs/move.ts
Download https://deno.land/std/fs/copy.ts
Download https://deno.land/std/fs/read_file_str.ts
Download https://deno.land/std/fs/write_file_str.ts
Download https://deno.land/std/fs/write_json.ts
Download https://deno.land/std/fs/eol.ts
Warning Implicitly using master branch https://deno.land/std/fs/ensure_symlink.ts
Warning Implicitly using master branch https://deno.land/std/fs/empty_dir.ts
Warning Implicitly using master branch https://deno.land/std/fs/ensure_dir.ts
Warning Implicitly using master branch https://deno.land/std/fs/expand_glob.ts
Warning Implicitly using master branch https://deno.land/std/fs/move.ts
Warning Implicitly using master branch https://deno.land/std/fs/write_file_str.ts
Warning Implicitly using master branch https://deno.land/std/fs/write_json.ts
Warning Implicitly using master branch https://deno.land/std/fs/ensure_file.ts
Warning Implicitly using master branch https://deno.land/std/fs/ensure_link.ts
Warning Implicitly using master branch https://deno.land/std/fs/copy.ts
Warning Implicitly using master branch https://deno.land/std/fs/read_file_str.ts
Warning Implicitly using master branch https://deno.land/std/fs/eol.ts
Download https://deno.land/std/fs/_util.ts
Warning Implicitly using master branch https://deno.land/std/fs/_util.ts
error: TS2345 [ERROR]: Argument of type '{ type: string; }' is not assignable to parameter of type 'string'.
    await Deno.symlink(originSrcFilePath, dest, {

    at https://deno.land/std/fs/copy.ts:117:49

TS2345 [ERROR]: Argument of type '{ type: string; }' is not assignable to parameter of type 'string'.
    Deno.symlinkSync(originSrcFilePath, dest, {

    at https://deno.land/std/fs/copy.ts:141:47

TS2345 [ERROR]: Argument of type '{ type: string; }' is not assignable to parameter of type 'string'.
    await Deno.symlink(src, dest, {

    at https://deno.land/std/fs/ensure_symlink.ts:33:35

TS2345 [ERROR]: Argument of type '{ type: string; }' is not assignable to parameter of type 'string'.
    Deno.symlinkSync(src, dest, {

    at https://deno.land/std/fs/ensure_symlink.ts:65:33

Found 4 errors.

tubbo avatar May 19 '20 00:05 tubbo

Thanks for the update @tubbo Is there a way to sponsor a coffee or a beer for you?

fmquaglia avatar May 21 '20 11:05 fmquaglia

@fmquaglia my venmo is @tubbo :)

tubbo avatar Jun 05 '20 06:06 tubbo

@tubbo I tried, but can not use it outside the US. I'm in Argentina. Paypal?

fmquaglia avatar Jun 05 '20 14:06 fmquaglia

my paypal is tubbo (at) psychedeli (dot) ca

tubbo avatar Jun 05 '20 19:06 tubbo