Quantcast
Channel: Active questions tagged require - Stack Overflow
Viewing all articles
Browse latest Browse all 153

require is not defined in ES module scope, you can use import instead

$
0
0

I got this errer messages when using require:

const ideasRouter = require('./routes/ideas'); ^ ReferenceError: require is not defined in ES module scope, you can use import instead

I want to import router from './routes/ideas.mjs'; but not working. How to solve this problem?


Viewing all articles
Browse latest Browse all 153

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>