json-schema-ref-parser icon indicating copy to clipboard operation
json-schema-ref-parser copied to clipboard

[help wanted] Importing $RefParser causing 'Uncaught ReferenceError: require$$0 is not defined' error.

Open ShlomiAmichay opened this issue 3 years ago • 3 comments

I've been trying to use this library in my Svelte App, but for some reason when I try to import $RefParser like so: import $RefParser from '@apidevtools/json-schema-ref-parser'; My App logs the following error to the console: Uncaught ReferenceError: require$$0 is not defined. I'm using rollup as my bundler, here's my plugins configuration within my rollup.config.js file:

plugins: [
        svelte({
            emitCss: false,
            compilerOptions: {
                dev: !production
            }
        }),
        resolve({
            browser: true,
            dedupe: ['svelte']
        }),
        commonjs({
            include: 'node_modules/**'
        }),
        jsonPlugin(),

I've been trying to play with the plugins order and parameters, but so far nothing seems to make it work.

ShlomiAmichay avatar Jan 20 '22 12:01 ShlomiAmichay

I am also getting the same error, have you managed to fix it in the past 8 months

mrmelon54 avatar Sep 17 '22 22:09 mrmelon54

In the last 8 months I’ve been scaling the growth of a climate action charity, and I’ve been asking you all for pull requests to help with bugs you’re experiencing. Please do send in some fixes with a few tests and we can get this issue closed.

philsturgeon avatar Sep 18 '22 05:09 philsturgeon

I made my own system for my project anyway as other ref-parser's didn't work well for me, but I'll leave this open incase someone wants to fix it

mrmelon54 avatar Oct 18 '22 08:10 mrmelon54