GithubHelp home page GithubHelp logo

thasmo / external-svg-polyfill Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 2.0 108 KB

Small and basic polyfill to support referencing external SVG files.

License: MIT License

HTML 26.53% JavaScript 5.54% TypeScript 67.93%
polyfill svg external npm browser inline embed legacy fallback

external-svg-polyfill's Issues

Module not found

After upgrading from Webpack Encore 0.33 to 1.7.0 I have the following error:

> encore production
Running webpack ...
 WARN  Compiled with 1 warnings7:47:55 AM
 warn  in ./packages/theme/Resources/Private/Js/main.js7:47:55 AM
export 'default' (imported as 'ExternalSvgPolyfill') was not found in '@thasmo/external-svg-polyfill' (module has no exports)
 ERROR  Failed to compile with 1 errors7:47:55 AM
Module build failed: Module not found:
"./node_modules/@thasmo/external-svg-polyfill/module/index.js" contains a reference to the file "./core/Polyfill".
This file can not be found, please check it for typos or update it if the file got moved.
Entrypoint main = runtime.f831b087.js 189.1818b934.js 800.6b815a86.js main.7c7f9bd6.css main.bb64df66.js 73 auxiliary assets
webpack compiled with 1 error and 1 warning

The main difference is, that Webpack Encore 1.x uses Webpack 5 instead of Webpack 4.

workaround

When I change the import from

export { default } from './core/Polyfill';

to

export { default } from './core/Polyfill.js';

it works fine.

Also: when I remove "type": "module", from your npm-package's package.json - it compiles fine too.

I know that in Webpack 5 something changed about Node modules loading. But I thought that referes only to old "require" statements and default Node.js modules like "path" and so on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.