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

new Map( ) undefined in IE 10 #13

Open
krishnakumar-g opened this issue Oct 26, 2016 · 7 comments
Open

new Map( ) undefined in IE 10 #13

krishnakumar-g opened this issue Oct 26, 2016 · 7 comments

Comments

@krishnakumar-g
Copy link

krishnakumar-g commented Oct 26, 2016

Getting "Map is undefined with new Map() method" error in IE 10 with joi-browser latest version 9.1.0

Refer the attached screenshot for more information and do the needful.

@maitriyogin
Copy link

Hi,
I'm also getting this in phantomjs!
I'v followed the webpack instructions to the best of my knowledge but get this error when running in phantom :
ReferenceError: Can't find variable: Map

:469
:4646 in clone
:107
:439
:30 in webpack_require
:59
:30 in webpack_require
:50
:10618
:3 in webpackUniversalModuleDefinition
:10620
TypeError: 'undefined' is not a function (evaluating '_joiBrowser2.default.object()')

Super annoying as joi is amazing! and we need our e2e tests to work!!
Look forward to any help,
Stephen.

@jeffbski
Copy link
Owner

I guess we'll need to tweak babel, possibly including the corejs/babel polyfill for Map

@maitriyogin
Copy link

hmm we're already including the babel-polyfill when we run e2e.
Is there anything else I should try and tweak ?

entry: {
    app: [
      ...(__IS_E2E ? [
        'babel-polyfill'
      ] : []),
      ...(__IS_DEVELOPMENT ? [
        'webpack-hot-middleware/client'
      ] : []),
      './src/index.js'
    ],
    vendor: require('./src/vendor')
  },

/Stephen.

@krishnakumar-g
Copy link
Author

Version 9.1.0 is not working in IE10, even when I added coreJS/babel polyfills.

It is working in IE10, when I changed the version to 9.0.0. 'new Map()' is not there in this version and it is working fine.

Thanks for your quick reply and suggestions:)

@Stas-Buzunko
Copy link

Hi, fixed it by importing Map to test bundler directly. Maybe not the best solution, but works. I had to import Promise as well

import Promise from 'es6-promise'
import Map from 'es6-map'

@jeffbski
Copy link
Owner

@Stas-Buzunko thanks for reporting back. I guess we can add that to the readme and people can include those polyfills if they need them for their browsers. Probably not needed in most newer browsers.

@jeffbski
Copy link
Owner

I've added a note to joi-browser and joi-full about how to add in Promise and Map polyfills if needed in th README's. Let me know if there is anything else you all think we need to do.

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

4 participants