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 read properties of undefined (reading 'code') #69

Open
ralyodio opened this issue Jun 28, 2022 · 3 comments
Open

Cannot read properties of undefined (reading 'code') #69

ralyodio opened this issue Jun 28, 2022 · 3 comments

Comments

@ralyodio
Copy link



Cannot read properties of undefined (reading 'code')

TypeError: Cannot read properties of undefined (reading 'code')
    at addFormats (/home/ettinger/src/avenasea.com/avenasea-ui/node_modules/ajv-formats/dist/index.js:30:26)
    at Proxy.formatsPlugin (/home/ettinger/src/avenasea.com/avenasea-ui/node_modules/ajv-formats/dist/index.js:15:5)
    at schema@blank.svelte:8:12
	import Ajv from 'ajv';
	import addFormats from 'ajv-formats';

	const ajv = new Ajv({ allErrors: true, strictSchema: false });
	addFormats(ajv);
@volnyansky
Copy link

volnyansky commented Jul 12, 2022

@ralyodio faced the same issue. Found following workaround:

const instance = new Ajv();
    if (!instance.opts) {
        // @ts-ignore
        instance.opts = { code: {} };
    }
    const ajv = addFormats(instance);

It looks like node platform issue, all works fine on macOs and crashes on linux.

@dipunm
Copy link

dipunm commented Jul 13, 2022

This doesn't work on my Mac:

MacBook Pro (14-inch, 2021)
Chip: Apple M1 Pro

@cheburan
Copy link

The Same. Have these issues on my MacBook Pro (14-inch 2021), Chip: M1 Pro. Workaround helped

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

No branches or pull requests

4 participants