nandorojo / burnt

Crunchy toasts for React Native. 🍞
MIT License
1.2k stars 37 forks source link

Unable to resolve "sonner" #26

Closed timoisalive closed 1 year ago

timoisalive commented 1 year ago

Hmm, I'm getting

Unable to resolve "sonner" from "node_modules/burnt/build/web.js"

I have installed sonner, even tried an older version of it.

I'm running an Expo 49 project.

nandorojo commented 1 year ago

seems like something is up with metro web here

timoisalive commented 1 year ago

Ok, thanks for looking into it! I'll keep following the thread...

bryanltobing commented 1 year ago

not sure if this is the same case. but this is happening to me with react-hook-form. i added this and it fixes the issue


// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');

/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);

config.transformer.getTransformOptions = async () => ({
  transform: {
    experimentalImportSupport: true,
  },
});

+config.resolver.sourceExts.push('mjs');
+config.resolver.sourceExts.push('cjs');

module.exports = config;
mduc-dev commented 1 year ago

yup, I got the same error, even though I downloaded npm sooner

nandorojo commented 1 year ago

Did you try the workaround?

mduc-dev commented 1 year ago

Did you try the workaround?

ye, The solution above helped me solve this problem

nandorojo commented 1 year ago

New Expo Web docs on the README have been added solving this.

timoisalive commented 1 year ago

Nice, thanks a bunch! 🙏