rollup / rollup-plugin-image

This module has moved and is now available at @rollup/plugin-image / https://github.com/rollup/plugins/blob/master/packages/image
41 stars 13 forks source link

Error when importing (iife format) #2

Closed arthurmchr closed 4 years ago

arthurmchr commented 8 years ago

Hi,

I got an error when i try to use this plugin : logo.svg does not export default

I must doing something wrong but I do not find. Here are the plugins I am using :

const plugins = [
    json(),
    image(),
    nodeResolve(),
    commonjs(),
    babel({
        presets: 'es2015-rollup',
        include: [
            '**/*.js'
        ],
        exclude: [
            'node_modules/**',
            'app/media/js/vendors/**'
        ]
    })
];

I follow the example to use it.

Thanks for any help.

austbot commented 8 years ago

Same here 0.36.1

piotr-cz commented 7 years ago

I'm getting an error 'default' is not exported by xxx.svg

antony commented 7 years ago

Also getting the same issue. Don't forget to vote on this issue.

legrego commented 6 years ago

This happens for the "es" and "cjs" formats too

timdp commented 6 years ago

I've created #7 with a workaround. You can install @timdp/rollup-plugin-image if you want to try it out.

lcfd commented 5 years ago

Same issue with Rollup v 1.1.0 Error: 'default' is not exported by icons/user.png

yash2code commented 5 years ago

same issue

regrettably commented 5 years ago

This is still an issue for me too.

antony commented 5 years ago

@timdp your package doesn't seem to fix this issue for me. Am I right to assume that a straight swap should be all that is required?

b12f commented 5 years ago

@maintainers are you actually looking at this? I've just ran into the same issue and can't believe this has been open since 2016.

antony commented 5 years ago

@b12f Weird, maybe they didn't get the paycheck you sent them. Perhaps try sending it again.

b12f commented 5 years ago

@antony chill bro I know OSS development ain't the most thankful job, but a "we're accepting PRs" on this is the least you can do. Plus there's a proposed fix by @timdp (which afaics doesn't work 100%), so that's a possible PR we could work from. I'd even chip in and write code as well, but that's not much use as long as the project appears abandoned.

antony commented 5 years ago

So feel free to check out the PR, diagnose, and fix the issues and resubmit.

The project isn't abandoned, it's in active use by a number of people (including me) every day. The maintainer is busy with a huge amount of other projects right now, so this one might not be the highest priority.

The project is awaiting your contribution, and should you be able to fix the issue, it will be merged in in due course.

houd1ni commented 5 years ago

@b12f it's better to make yet another JS-framework than maintain such a good thing as rollup for maintainers here =)

adonespitogo commented 5 years ago

@timdp 's fork worked for me.

shellscape commented 4 years ago

We're moving this plugin to https://github.com/rollup/plugins where it'll get some TLC. I'm running the changes in #7 by the team. From my local tests, it looks like it works. Keep an eye out for this repo being archived and @rollup/plugin-images.