Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin not initialized when compiling in Deno 1.7 #9257

Closed
wwderw opened this issue Jan 25, 2021 · 28 comments
Closed

Plugin not initialized when compiling in Deno 1.7 #9257

wwderw opened this issue Jan 25, 2021 · 28 comments
Labels

Comments

@wwderw
Copy link

wwderw commented Jan 25, 2021

When trying to compile on 1.7 it gives an error about plugin not being initialized (importing webview for this program), however, when doing deno run in 1.7 or when compiling on 1.6, everything works as expected without any changes to the code.

@nayeemrmn

This comment has been minimized.

@wwderw
Copy link
Author

wwderw commented Jan 25, 2021

In this case, I'm using webview. At most it's a combo of webview and abc. Although, I do have something coming down the pipeline for SQLite. But those would be my biggies for the foreseeable.

It compiles and runs fine in 1.6 (as long as I'm not attempting to change cache location), but it gives me that error with 1.7, everything else being the same.

@nayeemrmn
Copy link
Collaborator

Putting 1.6 aside, does this happen in 1.7 without changing the cache location?

@wwderw
Copy link
Author

wwderw commented Jan 25, 2021

Yes.

@nayeemrmn
Copy link
Collaborator

nayeemrmn commented Jan 25, 2021

Okay, please adjust the title and description of this issue to give less detail about that red herring and more about the error that you're seeing in 1.7 irrespective of DENO_DIR. Is "plugin must be initialized" a panic or what?

@wwderw
Copy link
Author

wwderw commented Jan 25, 2021

That I couldn't tell you if it was a panic or not. All I know that it works in 1.6, but it throws that error in 1.7. If everything else is equal.

@nayeemrmn
Copy link
Collaborator

Show the error exactly as it appears.

@wwderw
Copy link
Author

wwderw commented Jan 25, 2021

error: Uncaught The plugin must be initialized before use

That's all that it give back.

Deno run its fine, it just when I go to compile and then run the compiled binary.

@wwderw wwderw changed the title Changing DENO_DIR when Compiling Plugin not initialized when compiling in Deno 1.7 Jan 25, 2021
@lucacasonato
Copy link
Member

I assume this is a SWC bug with ordering of statements in the compiled bundle. We have a swc_bundler upgrade coming up, that might fix this. Lets hold this for 1.7.1 (should release some time this week).

@wwderw
Copy link
Author

wwderw commented Jan 27, 2021

I did try the canary build and got
error: ReferenceError: joinGlobs is not defined at file://$deno$/bundle.js:2638:20

Don't know if that would have been fixed when a point release came out or not, but thought I would mention it.

@wwderw
Copy link
Author

wwderw commented Jan 29, 2021

Yep, same error on 1.7.1 as I mentioned from 2 days ago using the official 1.7.1 release today.

@Miaourt
Copy link

Miaourt commented Jan 30, 2021

Can confirm, getting the exact same error on 1.7.1 mentioned there #9257 (comment), I'm running Windows 20H2

Using the webview plugin too.

@realJoshByrnes
Copy link
Contributor

Same error on 1.7.1 on MacOS: error: ReferenceError: joinGlobs is not defined at file://$deno$/bundle.js:2638:20

@jcc10
Copy link

jcc10 commented Feb 3, 2021

Just for reference the following code:

import { Webview } from "https://deno.land/x/webview@0.5.6/mod.ts";

const html = `
  <html>
  <body>
    <h1>Hello from deno v${Deno.version.deno}</h1>
  </body>
  </html>
`;

const webview = new Webview(
  { url: `data:text/html,${encodeURIComponent(html)}` },
);
await webview.run();

When compiled and ran returns

error: ReferenceError: joinGlobs is not defined
    at file://$deno$/bundle.js:2638:20

with

deno --version
deno 1.7.1 (release, x86_64-unknown-linux-gnu)
v8 8.9.255.3
typescript 4.1.3

running normally encounters no issues.

@Miaourt
Copy link

Miaourt commented Feb 7, 2021

Still getting this with Deno 1.7.2 + webview 0.5.6, on Windows 10 20H2

error: ReferenceError: joinGlobs is not defined
    at file://$deno$/bundle.js:2975:20```

@wwderw
Copy link
Author

wwderw commented Feb 7, 2021

Same here.

@jcc10
Copy link

jcc10 commented Feb 20, 2021

deno 1.7.5 (release, x86_64-unknown-linux-gnu)
v8 9.0.123
typescript 4.1.4
webview 0.5.6

No change

@RoXuS
Copy link

RoXuS commented Feb 24, 2021

+1 same here on 1.7.5

error: ReferenceError: joinGlobs is not defined
    at file://$deno$/bundle.js:2975:20

After compile on 1.7.5

@wwderw
Copy link
Author

wwderw commented Mar 3, 2021

The program appears to now compile, at least with Webview 0.5.3.

@jcc10
Copy link

jcc10 commented Mar 3, 2021

With Deno 1.7.5 and webview_deno 0.5.6 the following occurs:

./test1
Download https://github.com/webview/webview_deno/releases/download/0.5.6/libwebview_deno.so
error: ReferenceError: joinGlobs is not defined
    at file://$deno$/bundle.js:2975:20

With webview_deno 0.5.3 (Was testing report from @wwderw) the following occurs:

./test1b
error: ReferenceError: joinGlobs is not defined
    at file://$deno$/bundle.js:2599:20

I don't know when that changed or if I never noticed it. I'm still on Linux (Pop_OS! 20.04) so it might be that it's fixed on windows but not Linux IDK.

@wwderw
Copy link
Author

wwderw commented Mar 3, 2021

I'm on Linux, Ubuntu Studio beta 21.04, but I am using Deno 1.8, try the latest. It looks like you were still trying with 1.7.5 Deno.

@Miaourt
Copy link

Miaourt commented Mar 3, 2021

Can confirm it now works on Deno 1.8.

@jcc10
Copy link

jcc10 commented Mar 3, 2021

I swear I did try updateing before posting my last comment.

$ ./test1
Download https://github.com/webview/webview_deno/releases/download/0.5.6/libwebview_deno.so
$ ./test1b
$ 

Same web-views as before but on Deno1.8.0 Seems like something weird is happening with 0.5.6 downloading something every run but it does work.

I'm going to try cross-compiling for windows real quick.

@jcc10
Copy link

jcc10 commented Mar 3, 2021

Cross-compile from Linux to Windows works for webview_deno 0.5.6 so I think it is in fact fixed with 1.8.0 🎉

@wwderw
Copy link
Author

wwderw commented Mar 3, 2021

@realJoshByrnes Let me know how it fairs for you using 1.8 on a Mac.

If it appears to be good to go for you, I'll close this. Otherwise I'll leave it open if you are having issues.

@ralyodio
Copy link

ralyodio commented Mar 6, 2021

how do I compile my script?

@eliassjogreen
Copy link
Contributor

deno compile --unstable --allow-all main.ts

@stale
Copy link

stale bot commented May 5, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 5, 2021
@wwderw wwderw closed this as completed May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants