brunocodutra / webapp-webpack-plugin

[DEPRECATED] use favicons-webpack-plugin instead
https://www.npmjs.com/package/webapp-webpack-plugin
MIT License
125 stars 17 forks source link

Exclamation mark in `favicons` property value makes the build crash #162

Open mikroware opened 5 years ago

mikroware commented 5 years ago

Using something like this configuration below makes the build crash.

new WebAppWebpackPlugin({
    logo: 'image.png',
    favicons: {
        appName: 'Application!',
    },
});

Part of the error:

Error: Can't resolve '","developerName":null,"appDescription":"Description","version":"0.0.1"},"path":"/"}' in 'F:\IdeaProjects\Project\client'

....

using description file: F:\IdeaProjects\Project\package.json (relative path: ./node_modules/","developerName":null,"appDescription":"Description","version":"0.0.1"},"path":"/"})
            no extension
              F:\IdeaProjects\Project\node_modules\","developerName":null,"appDescription":"Description","version":"0.0.1"},"path":"\"} doesn't exist

Somehow the exclamation mark triggers a file path search within the itgalaxy/favicons package. Using this package directly does not give the error. Seems like the configuration is passed as a JSON string or something and somehow the favicons package cannot handle that. This also bugs on the appDescription property, so it seems to be unrelated to which property it is put on.

brunocodutra commented 5 years ago

Thanks for reporting, I'll investigate where exactly it's failing. My guess is that ! has special meaning when it's part of a file path, could that be?

mikroware commented 5 years ago

My guess is that the ! triggers some kind of file path resolve system. I am however not sure where it is. Since the ! is in the appName property, it is not directly a file path. But since it seems to be parsed as JSON before passing to the favicons packages, some sub system might think it should resolve something in the JSON as it is a string.

I hope I explained my view on it clear enough. When I have time I might be able to investigate the source of this bug.

brunocodutra commented 5 years ago

I hope I explained my view on it clear enough.

Yes, thank you.