question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use deno compile/bundle with Input due to ReferenceError

See original GitHub issue

Hi

I like the library a lot, thanks for working on it. However, I am running into an issue I am not familiar with:

System Windows 10 Deno 1.7.2


Issues

Scenario 1 (compile)

deno compile -o test --unstable https://deno.land/x/cliffy/examples/prompt/input.ts
./test.exe

Result 1

error: ReferenceError: Cannot access 'mod' before initialization
    at factory (file://$deno$/bundle.js:355:39)
    at file://$deno$/bundle.js:83:14

Scenario 2 (bundle)

deno bundle --unstable https://deno.land/x/cliffy/examples/prompt/input.ts test.js
deno run --unstable ./test.js

Result 2

error: Uncaught ReferenceError: Cannot access 'mod' before initialization
    const methodList = Object.entries(mod);
                                      ^
    at factory (file:///C:/Users/..../test.js:355:39)
    at file:///C:/Users/..../test.js:83:14

Notes


Questions

  • Any thoughts why this may be?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
c4sparcommented, Feb 10, 2021

I have created a deno issue: https://github.com/denoland/deno/issues/9467

0reactions
juliostanleycommented, Mar 12, 2021

Hi @c4spar, it works. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught ReferenceError when running bundle created with ...
I'm getting runtime errors when executing bundles created with Deno 1.5.x that I didn't get in 1.4.6: main.ts: example % cat main.ts import ......
Read more >
deno bundle | Manual
Bundling. deno bundle [URL] will output a single JavaScript file for consumption in Deno, which includes all dependencies of the specified input.
Read more >
How To Fix ReferenceError require is not defined in JavaScript
You tried using require in a browser environment; You are in a Node.js environment but your project has "type": "module" in its package.json....
Read more >
javascript - Uncaught ReferenceError: process is not defined
I am using the command "npm start" which refers to the "start" script inside package.json that is set to "start": "http-server -a localhost...
Read more >
Firebase JavaScript SDK Release Notes - Google
Fixed the Node.js ESM bundle to build from the Node.js entry point (it was incorrectly using the browser entry point). See Github issue...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found