danibram / mocker-data-generator

A simplified way to generate masive mock data based on a schema, you can use the awesome fake/random data generators like (FakerJs, ChanceJs, CasualJs and RandExpJs)
https://danibram.github.io/mocker-data-generator/
MIT License
426 stars 45 forks source link

./node_modules/faker/locale/ReadMe.md:1:1 - Error: Module parse failed: Unexpected character ' ' (1:1) #122

Closed Indronil closed 1 year ago

Indronil commented 1 year ago

I am getting an error and not a warning with angular 13 while running serve. Can somebody help me with it? ./node_modules/faker/locale/ReadMe.md:1:1 - Error: Module parse failed: Unexpected character ' ' (1:1) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

Read Me | | The files in this directory have been auto-generated from the gulpfile.

I am using “mocker-data-generator” and I guess this library is a dependent on that. Is there a solution to get around it? If we can ignore and bypass it or which loader to use and how.

danibram commented 1 year ago

Hi @Indronil ! Yes, this is a know error that we have because fakerjs inyects some md, and I think you need to change your webpack config to support load md files. I have no time to invest, but the idea is to transitionate to a model that you incorporate the generator you want, to not have this kind of issues. But for now I think that if you only add support for md files will be enough, another option is to remove that file from the node_modules in the transition. Im in progress to update faker to the community edition

Indronil commented 1 year ago

@danibram Thanks for the above comment, we do not use Webpack in our build process and using "yarn nx serve app-name" to serve in local host. Do you know how to provide support for md files, I mean the loader and where to add the loader in. We are using angular 13 with Nx.

danibram commented 1 year ago

Maybe with that -> https://nx.dev/more-concepts/customizing-inputs#global-settings trying to not parse any md file "!{projectRoot}/**/*.md",

Indronil commented 1 year ago

@danibram I do not think it is to do with NX global settings as it mainly is to invoke the cache mechanism for running targets if required. We need a way to bypass this *.md from the node modules of the library.

danibram commented 1 year ago

Good night! I just release a new version that remove all specific generators from the package so you shouldnt have this kind of error again. That is a breaking change and also schemas and generation must be updated, just in case =)