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

Cannot find es5-shim dependency from ace-builds/worker-* #755

Open
Lyeed opened this issue Dec 11, 2019 · 3 comments
Open

Cannot find es5-shim dependency from ace-builds/worker-* #755

Lyeed opened this issue Dec 11, 2019 · 3 comments
Labels

Comments

@Lyeed
Copy link

Lyeed commented Dec 11, 2019

Problem

I'm trying to update React-Ace to version 8 and i can't get the worker working.

/node_modules/ace-builds/src-min-noconflict/worker-css.js:1:2821: Cannot resolve dependency 'ace/lib/es5-shim'
image

I've seen people saying that it can be fixed by importing a webpack ace-build package but i'm using parcel not webpack

References

import AceEditor from 'react-ace';
import 'ace-builds/src-noconflict/worker-json';
import 'ace-builds/src-noconflict/mode-json';
import 'ace-builds/src-noconflict/theme-github';
import 'ace-builds/src-noconflict/ext-searchbox';
render() {
    <AceEditor
        mode='json'
        fontSize={14}
        theme='github'
        value={value}
        onChange={this.onChange}
        editorProps={{ $blockScrolling: true }}
        setOptions={{
            minLines: 4,
            maxLines: 30,
            enableBasicAutocompletion: true,
            enableLiveAutocompletion: true,
            enableSnippets: false,
            showLineNumbers: true,
            tabSize: 4,
            useWorker: true,
        }}
    />
}

Thanks :)

@bruncs
Copy link

bruncs commented Dec 12, 2019

I'm having the same issue with worker-javascript.

@Lyeed Lyeed changed the title Cannot find es5-shim dependency from ace-builds/worker-css Cannot find es5-shim dependency from ace-builds/worker-* Dec 12, 2019
@Fatmaghorbel
Copy link

any solution for this issue ??

@kiliman
Copy link

kiliman commented Apr 22, 2020

Kind of figured out a workaround (at least it's no longer a blocker at the moment)

Add the following to package.json https://en.parceljs.org/module_resolution.html#aliases

  "alias": {
    "ace/lib/es5-shim": "ace-builds/src-noconflict/ace.js"
  }

You'll also need to copy whatever worker-*.js files you need from node_modules/ace-builds/src-noconflict to the /dist folder.

Not sure why, but at least it builds and runs. 🤷‍♂️

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

No branches or pull requests

5 participants