justinribeiro / lite-youtube

The fastest little YouTube web component on this side of the internet. The shadow dom web component version of Paul's lite-youtube-embed.

Home Page:https://www.npmjs.com/package/@justinribeiro/lite-youtube

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webpack Error

ashfaq-shamsudeen opened this issue · comments

ModuleParseError: Module parse failed: Unexpected token (224:23)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| this.domRefImg.fallback.src = posterUrlJpeg;
| this.domRefImg.fallback.setAttribute('aria-label', ${this.videoPlay}: ${this.videoTitle});
this.domRefImg?.fallback?.setAttribute('alt', ${this.videoPlay}: ${this.videoTitle});
| }
| initIntersectionObserver() {

relevant snippet of webpack config:

{
test: /.(jpe?g|png|gif|svg)$/i,
loader: 'file-loader',
},

Anything missing here? Thanks!

Answer is in your webpack output:

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

Specifically, webpack 4.x for has problems with optional chaining (the line it's pointing to in your output) because of the acorn dependency. You can either use the workaround in this thread or move to webpack 5. webpack/webpack#10227