orangeslices
orangeslices
TTCTheo's Typesafe Cult
Created by orangeslices on 5/25/2023 in #questions
Issues Copying wasm files for Vercel/prod using create-t3-app
9 replies
TTCTheo's Typesafe Cult
Created by orangeslices on 5/25/2023 in #questions
Issues Copying wasm files for Vercel/prod using create-t3-app
I figured it out! It was actually a pathing issue The following code
webpack: (config, { isServer }) => {
// Only perform the following steps for the client-side bundle
if (!isServer) {
// Copy the WebAssembly files from node_modules to the output directory
const patterns = [
{
from: path.join('node_modules/onnxruntime-web/dist/*.wasm'),
to: 'static/wasm',
},
];

config.plugins.push(new CopyWebpackPlugin({ patterns }));
}

return config;
},
webpack: (config, { isServer }) => {
// Only perform the following steps for the client-side bundle
if (!isServer) {
// Copy the WebAssembly files from node_modules to the output directory
const patterns = [
{
from: path.join('node_modules/onnxruntime-web/dist/*.wasm'),
to: 'static/wasm',
},
];

config.plugins.push(new CopyWebpackPlugin({ patterns }));
}

return config;
},
Put the wasm assets in this directory
_next/static/wasm/onnxruntime-web/dist/
_next/static/wasm/onnxruntime-web/dist/
I checked Vercel's deployment logs to find the location of the files
9 replies
TTCTheo's Typesafe Cult
Created by orangeslices on 5/25/2023 in #questions
Issues Copying wasm files for Vercel/prod using create-t3-app
Im finally able to continue this, ill see if the link is the solution
9 replies
TTCTheo's Typesafe Cult
Created by orangeslices on 5/25/2023 in #questions
Issues Copying wasm files for Vercel/prod using create-t3-app
9 replies
TTCTheo's Typesafe Cult
Created by orangeslices on 5/25/2023 in #questions
Issues Copying wasm files for Vercel/prod using create-t3-app
9 replies