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 find module 'nimma/legacy' from SpectralCore Runner #2021

Closed
Amachua opened this issue Jan 14, 2022 · 2 comments
Closed

Cannot find module 'nimma/legacy' from SpectralCore Runner #2021

Amachua opened this issue Jan 14, 2022 · 2 comments

Comments

@Amachua
Copy link
Contributor

Amachua commented Jan 14, 2022

Describe the bug

When I load a YAML file and a custom spectral ruleset, then I would like that the spectral runner successfully finalize the analysis of the file (see following code) as it is currently blocked due to nimma.

export const repro = async (specificationPath: string, rulesetPath: string): Promise<boolean> => {

  const spectral = new Spectral({ resolver: httpAndFileResolver });

  const ruleset = await getRuleset(rulesetPath);

  spectral.setRuleset(ruleset);

  const document = new Document(
    await readParsable(specificationPath, { encoding: 'utf8' }),
    Parsers.Yaml,
    specificationPath,
  );

  await spectral.runWithResolved(
    document,
    {
      ignoreUnknownFormat: false,
    });

  return true;
};

To help you on the investigation, I have created a complete standalone repro case that is available at https://github.com/Amachua/spectral-repro.

@P0lip
Copy link
Contributor

P0lip commented Jan 16, 2022

It's not an issue with Spectral, but with Jest, namely jest-resolve, not supporting package exports.
Please refer to #2002 for a workaround.

@P0lip P0lip closed this as completed Jan 16, 2022
@Amachua
Copy link
Contributor Author

Amachua commented Jan 18, 2022

Thank you @P0lip for the quick answer, I have check the content of the workaround and it seems like it is working! Facing another issue at the moment and I might open another Issue when I have properly scope this latter. :)

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

No branches or pull requests

2 participants