Closed
Description
This is for the npm version of sass - 1.63.4
I have an esm file like this:
import sass from 'sass'
() => {
const webpackConfig = await import('./other-file');
}
other-file.js is a cjs file:
const sass = require('sass')
other-file throws an error:
TypeError: Cannot read properties of undefined (reading 'pop')
at Object.<anonymous> (/Users/path/to/node_modules/sass/sass.node.js:2:43)
It seems like its a problem with importing the package more than one time.
The setup here looks weird, but the reason is that the CJS file is our production build file, which we want to avoid doing experimental things with, and the esm file is our development build fill and I think this is a valid use case/bug.
reproducible stack-blitz: https://stackblitz.com/edit/stackblitz-starters-wm1r15?file=index.mjs