Unable to determine content type

I am trying out the new dfx version 0.7.0-beta.2, and I have taken a project that worked just fine previously and tried to deploy it. I am getting this error:

Building frontend...
Installing canisters...
Installing code for canister blog_frontend, with canister_id rrkah-fqaaa-aaaaa-aaaaq-cai
Authorizing our identity (default) to the asset canister...
Uploading assets to asset canister...
  /index.js 1/1 (25094 bytes)
Unable to determine content type for '/home/lastmjs/development/sudograph/examples/basic/.dfx/local/canisters/blog_frontend/assets/index.js.LICENSE'.

I am using webpack because that’s what we basically had to do before, and it looks like webpack is creating a license file, and because of the extension dfx is failing.

I don’t think the build should fail if the content type cannot be determined. But also, it would be nice to have the ability to set custom content types for files.

2 Likes

This is a bug. The build should not fail in this case. Thanks for this report!

3 Likes

I am able to get around this for now by setting extractComments to false in the TerserPlugin options in the webpack.config.js file that was provided in previous versions of dfx new.

But getting this fixed would be awesome!

And being able to set custom content types (really custom response headers) would be even better eventually!

3 Likes

Thanks all, issue tracked here. Looks like its already merged

It works if you put .txt at the end of the file name.