josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
816 stars 108 forks source link

When using the CDN version an error occurs #355

Closed chrisschippers closed 6 months ago

chrisschippers commented 6 months ago

When using the CDN version the following error occurs (in the console)

Uncaught TypeError: Failed to resolve module specifier "immutable-json-patch". Relative references must start with either "/", "./", or "../".

import { JSONEditor } from 'https://cdn.jsdelivr.net/npm/vanilla-jsoneditor/index.js'

This is using the sample in the repository.

Also using the sample at: https://jsbin.com/gatibux/edit?html,output

Last week it worked fine.

josdejong commented 6 months ago

Since the last version, v0.2.0, you have to use the standalone.js bundle:

import { JSONEditor } from 'https://cdn.jsdelivr.net/npm/vanilla-jsoneditor/standalone.js'

I indeed see that the jsbin example wasn't yet updated, I've fixed that now. Thanks for reporting!

Docs: https://github.com/josdejong/svelte-jsoneditor/blob/main/README-VANILLA.md#use Changelog: https://github.com/josdejong/svelte-jsoneditor/blob/main/CHANGELOG.md#0200-2023-12-06