Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

387
Views
GLSL File: "Module parse failed: Unexpected token"

I am building image transition with a custom shader and for this i need a fragment.glsl. But when importing this file into my .js, this error shows up:

Compiled with problems:

ERROR in ./src/shaders/fragment.glsl 1:13

Module parse failed: Unexpected token (1:13)
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
> void main () {
| 
| }

For a fast start i am using this webpack boilerplate: https://github.com/taniarascia/webpack-boilerplate

Because of my not existing experience in webpack and glsl files i dont know whats wrong. I am assuming, that the browser is not able to read the file. I tried a lot of stuff with webpack.config.js and modules like glfl-loader but looks like my browser got other plans.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

After testing around i found the solution:

i had to edit this to the webpack.config.js

// Shader

{ test: /\.(glsl|vs|fs|vert|frag)$/,  type: 'asset/source',generator: { filename: 'assets/images/[hash][ext]' }}
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!