Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Next.js: Module parse failed: Unexpected token (2:8) on v3.0.0-alpha.1 #95

Open
BrianLi101 opened this issue Jun 26, 2022 · 0 comments
Open

Comments

@BrianLi101
Copy link

Using the newest alpha version 3.0.0-alpha.1 of this library with Next.js results in the following compile error:

error - ./node_modules/@ensdomains/ensjs/dist/esm/functions/batch.d.ts
Module parse failed: Unexpected token (2:8)
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

Screen Shot 2022-06-25 at 9 20 45 PM

Earlier versions of the library like 2.1.0 have not caused this issue.

I was able to find a temporary workaround by using next-transpile-modules and modifying the next.config.js file in my project:

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  images: {
    domains: ['storage.googleapis.com'],
  },
};

const withTM = require('next-transpile-modules')(['@ensdomains/ensjs']); // pass the modules you would like to see transpiled

module.exports = withTM(nextConfig);

Raising this issue for visibility, hopefully it helps with identifying the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant