NuxtN
Nuxt2y ago
Bazze

Using nuxtjs/i18n types in a module

My last few braincells are fighting eachother over this problem..

Working on a nuxt module that uses nuxtjs/i18n.

I am using
import type { LocaleObject } from "@nuxtjs/i18n";


Typescript does not throw any errors during development.
Trying to build the module, it suddenly throws
 ERROR  Unexpected token (2:12) in \node_modules\@nuxtjs\i18n\dist\types.d.ts                                                                                                                                                13.22.55  

  at pp$4.raise (/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:21621:13)
  at pp$9.unexpected (/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:18829:8)
  at pp$9.expectContextual (/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:18783:41)
  at Parser.parseImport (/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:26127:14)
  at pp$8.parseStatement (/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:19005:49)
  at pp$8.parseTopLevel (/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:18886:21)
  at Parser.parse (/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:18658:15)
  at Function.parse (/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:18708:35)
  at Graph.contextParse (/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:25754:38)
  at tryParse (/node_modules/unbuild/node_modules/@rollup/plugin-commonjs/dist/es/index.js:17:12)


I have no idea whats going on.. Taking a look at the referred types file.
The problem is being pointed to the opening bracket { in the import statement.
import type { ModuleOptions, ModuleHooks, RuntimeModuleHooks, ModulePublicRuntimeConfig } from './module'

...
image.png
Was this page helpful?