When this line is completed:
import stats from `./${process.env.STATS}`
the error is reported below:
Analysis error: Unexpected token `
A module can be successfully loaded using the expression:
const stats = require(`./${process.env.STATS}`);
The import statement seems to require a regular line, since it works with the operator:
import stats from './statsdir'
where './statsdir' is the value of process.env.STATS .
Why does an error occur?
source share