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

Breaking expo web export #1426

Open
wcastand opened this issue Jun 17, 2023 · 0 comments
Open

Breaking expo web export #1426

wcastand opened this issue Jun 17, 2023 · 0 comments

Comments

@wcastand
Copy link

wcastand commented Jun 17, 2023

trying to export the expo web with expo-router and metro bundle and getting an error because of this package.

You do a weird import

const TextInputState = require('react-native/Libraries/Components/TextInput/TextInputState');

That breaks the web export since it needs to resolve to

const TextInputState = require('react-native-web/dist/modules/TextInputState');

but somehow doesn't which makes the build fail.

This import is done in src/helpers.ts

i tried module resolution from metro bundle but with no success so far.

	resolveRequest: (context, moduleName, platform) => {
		if (moduleName.includes("react-native/Libraries/Components/TextInput/TextInputState")) {
			return {
				filePath: path.resolve(workspaceRoot, "node_modules/react-native-web/dist/modules/TextInputState"),
				type: "sourceFile",
			}
		}
		// Optionally, chain to the standard Metro resolver.
		return context.resolveRequest(context, moduleName, platform)
	},

probably link to #917

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

1 participant