I’m using the preline/preline library in my Next.js (TypeScript) project. I followed the installation and setup instructions provided in the documentation. However, I’m encountering a build error that prevents the project from compiling. Below is the error message:
Module parse failed: Unexpected token (8:8)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
Steps to Reproduce:
- Installed preline using npm
- Followed the configuration steps from the documentation.
- Ran the development server using npm run dev
Environment Details:
• Next.js Version: 15.1.0
• TypeScript: Enabled
• Node.js Version: v20.15.1
PrelineScriot.tsx
custom.d.ts
layout.tsx
I tried to remedy the situation as follows
1