graphql / graphql/graphiql

[graphiql] simpleWorker.js can't access property "schemas" when using the cdn example

Open
#4,108 2 comments 3 reactions 0 assignees View on GitHub
bug graphiql
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Current Behavior

I get the following errors in the browser console:

```
setup-workers/esm.sh
Object { label: "json" }
[esm.sh.js:9:13](https://esm.sh/@graphiql/react@0.37.1/es2022/esm/npm/@graphiql/react@0.37.1/node_modules/@graphiql/react/dist/setup-workers/esm.sh.js)
Script error. [simpleWorker.js:29:13](https://esm.sh/@graphiql/react@0.37.1/X-ZUBlbW90aW9uL2lzLXByb3AtdmFsaWQsQGdyYXBoaXFsL3Rvb2xraXQsZ3JhcGhxbCxyZWFjdCxyZWFjdC1kb20/esm/npm/@graphiql/react@0.37.1/node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js)
TypeError: can't access property "schemas", l is undefined [json.worker.mjs:61:6527](https://esm.sh/monaco-editor@0.53.0/es2022/esm/vs/language/json/json.worker.mjs)
Uncaught
error { target: Worker, isTrusted: true, message: "Script error.", filename: "", lineno: 0, colno: 0, error: undefined, srcElement: Worker, eventPhase: 0, bubbles: false, … }
[errors.js:18:13](https://esm.sh/@graphiql/react@0.37.1/X-ZUBlbW90aW9uL2lzLXByb3AtdmFsaWQsQGdyYXBoaXFsL3Rvb2xraXQsZ3JhcGhxbCxyZWFjdCxyZWFjdC1kb20/esm/npm/@graphiql/react@0.37.1/node_modules/monaco-editor/esm/vs/base/common/errors.js)
```

### Expected Behavior

I expect the console to not log error messages.

### Steps To Reproduce

I copy the index.html file from [graphiql-cdn example](https://github.com/graphql/graphiql/tree/main/examples/graphiql-cdn) and load it in my webbrowser (through `python -m http.server`). This seems to work well, but if I look at the developer console while I edit the query I get the reported errors.

### Environment

* GraphiQL Version: latest
* OS: NixOS
* Browser: Firefox 142.0.1
* Bundler: CDN

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.