在 nextjs 中使用 ahooks 时,报错 SyntaxError: Cannot use import statement outside a module,如下图所示:

Next.js can automatically transpile and bundle dependencies from local packages (like monorepos) or from external dependencies (
node_modules). This replaces thenext-transpile-modulespackage.
翻译:Next.js 可以自动从本地包(如 monorepos )或外部依赖项转译和捆绑依赖项 node_modules 。这将替换 next-transpile-modules 包。
参考文档:
欢迎访问:天问博客