timkendrick / monaco-editor

CommonJS/Webpack compatible Monaco editor
MIT License
60 stars 7 forks source link

Es6 import is not working #2

Closed caracal7 closed 6 years ago

caracal7 commented 6 years ago

import monaco from '@timkendrick/monaco-editor';

TypeError: undefined is not an object (evaluating 'WEBPACK_IMPORTED_MODULE_6__timkendrick_monacoeditordefault.a.editor')

but CommonJS work fine

timkendrick commented 6 years ago

Hi there – sorry for such a delayed response, for some reason I've only just seen this message.

Looks like you're using the import default syntax, whereas if you look closely at the readme example for ES6 module usage, it should be the following (note the *):

import * as monaco from '@timkendrick/monaco-editor';

Feel free to reopen if you're still having problems.