Closed benjaminkwokhuen closed 2 years ago
This is becuase nextjs doesn't support es modules properly yet. See this thread and comment: https://github.com/vercel/next.js/issues/9890#issuecomment-968365119
The solution is to use next-transpile-modules
in your next.config.js.
const withTM = require('next-transpile-modules')(['mst-query']);
module.exports = withTM({
...
});
@k-ode Thanks a lot. It works now.
Got
SyntaxError: Cannot use import statement outside a module
The module does not work in server side.