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

WebP file support #58

Open
ostrichegret opened this issue May 21, 2019 · 1 comment
Open

WebP file support #58

ostrichegret opened this issue May 21, 2019 · 1 comment

Comments

@ostrichegret
Copy link

Fresh installed cra-ssr from git clone


import StoreFeature_1 from './feature_1.jpg';
import StoreFeature_1w from './feature_1.webp';

<picture>
          <source srcset={StoreFeature_1w} type="image/webp" />
          <source srcset={StoreFeature_1} type="image/jpeg" />
          <img src={StoreFeature_1} alt="Alt Text!" />
        </picture>

yarn start works fine

but yarn build and serve got error:


(node:33924) UnhandledPromiseRejectionWarning: D:\cra-ssr\src\app\routes\homepage\feature_1.webp:1
(function (exports, require, module, __filename, __dirname) { RIFF�
                                                                  ^

SyntaxError: Invalid or unexpected token
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)

    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (D:\REQCODE\React\cra-ssr\node_modules\pirates\lib\index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
(node:33924) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by
rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:33924) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js proc
ess with a non-zero exit code.
Done in 10.56s.

@cereallarceny cereallarceny mentioned this issue Jun 19, 2019
16 tasks
@cereallarceny
Copy link
Owner

Hey, my apologies for the long wait @ostrichegret - I'm looking to ensure this is fixed with version 2.0. If you're interested, I could really use your thoughts for what you'd like to see in the upcoming version. Feel free to comment on the issue here with any suggestions. :)

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