Node packages cannot be imported in the main thread using the import syntax #338
chunfenghuayu1
started this conversation in
General
Replies: 2 comments 1 reply
-
i cannot understand why electron can use import,but express cannot? |
Beta Was this translation helpful? Give feedback.
0 replies
-
This may be a problem caused by But. You can move |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
for example:
if i use express/express-http-proxy in main thread
const express = require('express') const expressProxy = require('express-http-proxy')
it will be normal。
but when i use import syntax
import express from 'express' import expressProxy from 'express-http-proxy'
it will output a error:
TypeError: require$$0$2 is not a functionat D:\code
if it my project problem,how i fix it?
Beta Was this translation helpful? Give feedback.
All reactions