How I Fixed @parcel/core: Failed to resolve './../fonts/icomoon.eot?1oniuf' from './css/icomoon.css'


parcel npm

Got this error while running the npm run build command in the projects with Parcel 2.0.0-rc.0:

@parcel/core: Failed to resolve './../fonts/icomoon.eot?1oniuf' from './css/icomoon.css'

The code was looking like this:

@font-face {
    font-family: 'icomoon';
    src: url('fonts/icomoon.eot?1oniuf');
    src: url('fonts/icomoon.eot?1oniuf#iefix') format('embedded-opentype'),
        url('fonts/icomoon.ttf?1oniuf') format('truetype'),
        url('fonts/icomoon.woff?1oniuf') format('woff'),
        url('fonts/icomoon.svg?1oniuf#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
}

My project had this structure:

...
css
- style.css
package.json
...

I have experimented and tried to change the URLs, but the following change was a solution:

@font-face {
    font-family: 'icomoon';
    src:    url('../fonts/icomoon/icomoon.eot?1oniuf');
    src:    url('../fonts/icomoon/icomoon.eot?1oniuf#iefix') format('embedded-opentype'),
        url('../fonts/icomoon/icomoon.ttf?1oniuf') format('truetype'),
        url('../fonts/icomoon/icomoon.woff?1oniuf') format('woff'),
        url('../fonts/icomoon/icomoon.svg?1oniuf#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
}
comments powered by Disqus