Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading "./intl" module with Webpack (safari) #98

Closed
tiagogm opened this issue Apr 14, 2016 · 1 comment
Closed

Error loading "./intl" module with Webpack (safari) #98

tiagogm opened this issue Apr 14, 2016 · 1 comment

Comments

@tiagogm
Copy link

tiagogm commented Apr 14, 2016

Hi, I this might be related to this #61, but there is no information there on how to solve it, at least not with webpack.

The plugin is throwing an error when trying to load the intl polyfill (in per ex, safari)

I just used the fresh webpack-skeleton and installed the plugin
npm install aurelia-i18n --save

then configured webpack.config.js with

 new AureliaWebpackPlugin({
      includeSubModules: [
        { moduleId: "aurelia-i18n" }
      ]
    }),

and included the plugin

    .plugin('aurelia-i18n', instance => {
      return instance.setup({
          backend: {                                  // <-- configure backend settings
            loadPath: '/locales/{{lng}}/{{ns}}.json', // <-- XHR settings for where to get the files from
          },
          lng : 'de',
          attributes : ['t','i18n'],
          fallbackLng : 'en',
          debug : false
        });
    })

When I run npm run dev, it runs fine on browsers that support intl api on browsers that don't, it's failing to load the polyfill.

"Cannot find module './intl'."

Any ideas?
Thanks!

@tiagogm tiagogm changed the title Webpack not error loading "./intl" module (safari) Error loading "./intl" module with Webpack (safari) Apr 14, 2016
@EisenbergEffect
Copy link
Contributor

There's not a strong reference to intl because it is only loaded when needed. This works fine with a real module loader, but not so much with webpack, which is only a bundler and requires it to be in the bundle. I'm not a webpack expert, but you will need to somehow tell it to include intl in the bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants