Error when running expo start --web

Hi, first of all thank you for Expo, this is a very efficient and useful tool to have!
But I’ve been experiencing a weird issue : I’m trying to build an app that works both in web and in mobile.
When I run it on mobile, it works fine - but on web, I get an error :

(path to the node_modules package)

Module parse failed: Unexpected token (14:12)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

(callback function)

I have no clue what’s causing this :frowning:
Any help would be welcome!

Problem solved, I found/stumbled upon the same issue and a working solution here : https://github.com/expo/expo/issues/6157

Sorry for the inconvenience!

1 Like

Here are docs on the latest approach for including modules to transpile with Babel in Webpack
webpack-config: include modules

Hi @bacon

I followed the instructions at the link you posted, but did not manage to have the Expo Web working. Do you know what I am missing?

My webpack.config.js is the default:

const createExpoWebpackConfigAsync = require('@expo/webpack-config');

module.exports = async function(env, argv) {
  const config = await createExpoWebpackConfigAsync(
    {
      ...env,
      babel: {
        dangerouslyAddModulePathsToTranspile: [
          // Ensure that all packages starting with @evanbacon are transpiled.
          '@evanbacon',
        ],
      },
    },
    argv
  );

  // Customize the config before returning it.
  return config;
};