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

Browser compatibility #9

Open
micahkendall opened this issue Dec 21, 2023 · 1 comment
Open

Browser compatibility #9

micahkendall opened this issue Dec 21, 2023 · 1 comment

Comments

@micahkendall
Copy link
Member

Currently I use translucent in browser environment via a messy polyfill. See below:

resolve: {
		alias: {
			'node-fetch': 'node-fetch-polyfill',
			'sha256': 'tiny-sha256',
			'@sinclair/typebox': '@sinclair/typebox',
			'@dcspark/cardano-multiplatform-lib-nodejs': '@dcspark/cardano-multiplatform-lib-browser',
			'uplc-node': 'translucent/uplc/pkg-web',
			'@emurgo/cardano-message-signing-nodejs': '@emurgo/cardano-message-signing-browser',
		}
	},
optimizeDeps: {
		exclude: ['translucent', 'typebox'],
    ...
	},

We should improve this to make browser integration simpler but I'm not enough of a package managing whiz to know how exactly.

@iburzynski
Copy link

I tried using this polyfill with Vite but when I run the dev server I get a ton of "Could not read from file" errors

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

2 participants