question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use webpack or rollup to export package properly

See original GitHub issue

Tried to integrate simple example in my code base today and ran into that error "export ‘withNamespaces’ was not found in ‘…/i18n’

i18n.js:

import NextI18Next from 'next-i18next'

const options = {}
export default new NextI18Next(options)

next-i18next: v0.23.1 i18next: v.14.0.1 react-i18next: v9.0.9 next: v7.0.2 react: v16.6.3 node: v11.6.0 npm: v6.6.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

6reactions
RobinDvorakcommented, Jan 29, 2019

You can use this workaroud:

const i18n = new NextI18Next(options);
export default i18n;
export const withNamespaces = i18n.withNamespaces;
export const Link = i18n.Link;
export const Trans = i18n.Trans;
export const appWithTranslation = i18n.appWithTranslation;
export const config = i18n.config;
4reactions
ali-turkicommented, Sep 22, 2019

TypeError: Cannot read property ‘cloneInstance’ of undefined

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use webpack or rollup to export package properly #138 - GitHub
Tried to integrate simple example in my code base today and ran into that error "export 'withNamespaces' was not found in '../i18n' i18n.js:...
Read more >
How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Learn how to use Rollup as a smaller, more efficient alternative to webpack and Browserify to bundle JavaScript files in this step-by-step tutorial...
Read more >
Rollup vs. Webpack -- A Comparison - OpenReplay Blog
Webpack lacks node polyfills for import/export, while Rollup does. Since Webpack does not accept relative paths but Rollup does, we must use ......
Read more >
rollup.js
js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the...
Read more >
Package exports - webpack
The exports field in the package.json of a package allows to declare which ... rollup, yes, Use exportConditions option for @rollup/plugin-node-resolve.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found