Archived

This forum has been archived. Please start a new discussion on GitHub.

Map object not recognized by Ice (Javascript)

Hello !

I set up a Webpack project using Ice.
To do so, I followed the documentation, using : npm install ice --save
Being unable to use the usual Ice commands lines, I proceeded like this :
In the webpack config file, I added

    module.exports = {
      entry: {
        Ice:  './src/Ice/Ice.min.js',
        Glacier2:  './src/Ice/Glacier2.min.js',
        IceGrid:  './src/Ice/IceGrid.min.js',
        IceStorm:  './src/Ice/IceStorm.min.js',
        MyIceItf : './src/Ice/itf/MyIceItf.js',
      app: './src/main.js'
      },
    ...
    }

I specify that I recovered these minified files in the folder "nodes_modules/ice/lib/es5" where the Ice files were installed during the npm installation command. I took these files in "es5" folder because the non-es5 files didn't work in my project (same problem as discussion : https://forums.zeroc.com/discussion/comment/47003#Comment_47003)

Once I could use the Ice, I tested my Ice interface but I faced a new problem :

    Ice.min.js?b0b9:6 Uncaught (in promise) Error: illegal context value, expecting null or Map
        at Promise.e (webpack-internal:///193:4537:21)
        at Function.e (webpack-internal:///193:4948:15)
        at _class17.e.(anonymous function) [as getSystemManager] (webpack-internal:///193:5239:31)
        at eval (webpack-internal:///294:55:16)
        at <anonymous>

After few tests, I assumed that the map object used in Ice.min.js was diverging from the Map object used in my project.
In order to work around the problem, I had to add, in the Ice.min.js file and in my project, the following line :

    var Map = require('es6-map');

So I share my workaround if it can helps some of you.

Cheers,

T.

Tagged:

Comments