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

nodejs/node #39

Open
bdougie opened this issue Sep 9, 2020 · 2 comments
Open

nodejs/node #39

bdougie opened this issue Sep 9, 2020 · 2 comments

Comments

@bdougie
Copy link
Owner

bdougie commented Sep 9, 2020

node #33460

write a test for await Promise.resolve()

#33741
console.log(require)

test

@bdougie
Copy link
Owner Author

bdougie commented Nov 2, 2020

could be a js file if typr module

mjs file

node already knows it is a module.

file:///private/var/folders/7t/thbq5c7x72q06b5c4c7dj6xc0000gn/T/test/index.mjs:1
const data = require('./data.json')
             ^
ReferenceError: require is not defined
    at file:///private/var/folders/7t/thbq5c7x72q06b5c4c7dj6xc0000gn/T/test/index.mjs:1:14
    at ModuleJob.run (internal/modules/esm/module_job.js:146:23)
    at async Loader.import (internal/modules/esm/loader.js:165:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)

@bdougie
Copy link
Owner Author

bdougie commented Nov 2, 2020

wrap the await in a try/catch

check errors.js

make reference error more informative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant