Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve "burnt" from "node_modules/@tamagui/toast/dist/cjs/createNativeToast.native.js" #878

Closed
alyiev opened this issue Apr 1, 2023 · 3 comments

Comments

@alyiev
Copy link

alyiev commented Apr 1, 2023

After updating all packages to version 1.9.22 getting this error:

image

deps:

    "@tamagui/animations-react-native": "^1.9.22",
    "@tamagui/animations-reanimated": "^1.9.22",
    "@tamagui/config": "^1.9.22",
    "@tamagui/shorthands": "^1.9.22",
    "@tamagui/theme-base": "^1.9.22",
    "react-native-web": "^0.19.1",
    "tamagui": "^1.9.22",

dev deps:

    "@tamagui/babel-plugin": "^1.9.22",
    "babel-plugin-transform-inline-environment-vaÏriables": "^0.4.4",

config:

import { shorthands } from '@tamagui/shorthands';
import {
  color,
  radius,
  size,
  space,
  themes,
  zIndex,
} from '@tamagui/theme-base';
import { createAnimations } from '@tamagui/animations-reanimated';
import { createFont, createTamagui, createTokens } from 'tamagui';

const animations = createAnimations({
  bouncy: {
    type: 'spring',
    damping: 10,
    mass: 0.9,
    stiffness: 100,
  },
  lazy: {
    type: 'spring',
    damping: 20,
    stiffness: 60,
  },
  quick: {
    type: 'spring',
    damping: 20,
    mass: 1.2,
    stiffness: 250,
  },
});

const mainFont = createFont({
  family: 'andika400r',
  lineHeight: {
    1: 14,
  },
  size: {
    1: 14,
    2: 16,
    3: 18,
    4: 20,
  },
  letterSpacing: {
    1: 0,
  },
  weight: {
    4: 400,
    7: 700,
  },
});

const tokens = createTokens({
  size,
  space,
  zIndex,
  color,
  radius,
});

const config = createTamagui({
  animations,
  defaultTheme: 'dark',
  shouldAddPrefersColorThemes: false,
  themeClassNameOnRoot: false,
  shorthands,
  fonts: {
    heading: mainFont,
    body: mainFont,
  },
  themes,
  tokens,
});

export default config;

script:

"start": "expo start -c --dev-client",

@griffithcaleb
Copy link

yarn add burnt --dev worked for me

@alyiev
Copy link
Author

alyiev commented Apr 1, 2023

@griffithcaleb this is good, but seems that I don't have to install it manually, in the doc there is no mention about this package. It looks like a bug.

Or am I missing something, but I have followed the documentation

@natew
Copy link
Member

natew commented Apr 1, 2023

Metro really really forces your hand unfortunately, we have docs in Toast on setting this up but even if you don't import this it eagerly tries to load everything. They don't support dynamic import or lazy evaluation here:

facebook/metro#52

We had some install docs about burnt but it said it was optional, I've clarified that. We'll look a better solution shortly.

@natew natew closed this as completed Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants