Skip to content

Commit

Permalink
fix(framework): Experiement with importing json-schema-faker (#6762)
Browse files Browse the repository at this point in the history
  • Loading branch information
SokratisVidros authored Oct 24, 2024
1 parent 6c8a47d commit af72058
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/framework/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import JSONSchemaFaker from 'json-schema-faker';
import { Liquid } from 'liquidjs';
import ora from 'ora';

Expand Down Expand Up @@ -40,6 +39,12 @@ import { WithPassthrough } from './types/provider.types';
import { EMOJI, log, sanitizeHtmlInObject, stringifyDataStructureWithSingleQuotes } from './utils';
import { transformSchema, validateData } from './validators';

/*
* JSONSchemaFaker needs to be imported as CJS to avoid HMR and Webpack issues when importing @novu/framework
* in Next.js. See https://github.com/json-schema-faker/json-schema-faker/issues/796#issuecomment-2433335751
*/
const { JSONSchemaFaker } = require('json-schema-faker');

/**
* We want to respond with a consistent string value for preview
*/
Expand Down

0 comments on commit af72058

Please sign in to comment.