brunocodutra/webapp-webpack-plugin

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

Opened this issue · 3 comments

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.

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?

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.

I hope I explained my view on it clear enough.

Yes, thank you.