Currently svgmoji can't be used as a dependency through webpack.
Error
Module not found: Package path ./emoji.json is not exported from package /Users/alex/repos/reflect-mobile-web/node_modules/svgmoji (see exports field in /Users/alex/repos/reflect-mobile-web/node_modules/svgmoji/package.json)
null
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './emoji.json' is not defined by "exports" in /Users/alex/repos/reflect-mobile-web/node_modules/svgmoji/package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:290:9)
at packageExportsResolve (internal/modules/esm/resolve.js:513:3)
at resolveExports (internal/modules/cjs/loader.js:432:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Function.mod._resolveFilename (/Users/alex/repos/reflect-mobile-web/node_modules/next/dist/build/webpack/require-hook.js:4:1784)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/Users/alex/repos/reflect-mobile-web/node_modules/@team-reflect/reflect-editor/dist/extensions.js:18:38)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Summary
Currently svgmoji can't be used as a dependency through webpack.
Error
Solution
Add
emoji.json
to exports:package.json: