RONEN
RONEN
SSolidJS
Created by RONEN on 6/30/2023 in #support
Example of using createWebSocketServer within an API endpoint with SSR: false
Is there a simple example of using createWebSocketServer within an API enpoint? Current with-websocket example seems to only work with SSR: true
1 replies
SSolidJS
Created by RONEN on 6/18/2023 in #support
Build process stalls when global variables present
I am using solid-start and cloudflare-workers plugin for vite. I have API secrets that I defined within cloudflare. My problem is that my build process gets stalled when I define variables using these secrets, like so:
const secret: string = import.meta.env.DEV ? (process.env.SESSION_SECRET as string) : SESSION_SECRET
const secret: string = import.meta.env.DEV ? (process.env.SESSION_SECRET as string) : SESSION_SECRET
Build process stalls at solid-start rendering index.html...
2 replies
SSolidJS
Created by RONEN on 6/7/2023 in #support
Cannot exclude an external package from server bundle file
Hello humans. It's been 2 days now that I am struggling with this issue of not being able to exclude @supabase/supabase-js and its dependancies from the final server.js file. I am using Cloudflare workers solid adapter. I've tried all possible combinations to mark the library as external with no luck. Here is my vite.ts file.
import solid from 'solid-start/vite'
import { defineConfig } from 'vite'
import cloudflare from 'solid-start-cloudflare-workers'
import createExternal from 'vite-plugin-external'

export default defineConfig({
plugins: [
solid({
ssr: false,
exclude: ['@supabase/supabase-js', 'node_modules'],
adapter: cloudflare({
wranglerConfigPath: true,
}),
}),
createExternal({
externals: {
supabase: '@supabase/supabase-js',
},
}),
],
envPrefix: 'PUBLIC_',
server: {
port: 8010,
},
build: {
rollupOptions: {
external: ['node_modules', '@supabase/supabase-js'],
output: {
globals: {
'@supabase/supabase-js': '@supabase/supabase-js',
},
},
},
},
optimizeDeps: {
disabled: true,
exclude: ['node_modules', '@supabase/supabase-js'],
},
ssr: {
external: ['node_modules', '@supabase/supabase-js'],
},
})
import solid from 'solid-start/vite'
import { defineConfig } from 'vite'
import cloudflare from 'solid-start-cloudflare-workers'
import createExternal from 'vite-plugin-external'

export default defineConfig({
plugins: [
solid({
ssr: false,
exclude: ['@supabase/supabase-js', 'node_modules'],
adapter: cloudflare({
wranglerConfigPath: true,
}),
}),
createExternal({
externals: {
supabase: '@supabase/supabase-js',
},
}),
],
envPrefix: 'PUBLIC_',
server: {
port: 8010,
},
build: {
rollupOptions: {
external: ['node_modules', '@supabase/supabase-js'],
output: {
globals: {
'@supabase/supabase-js': '@supabase/supabase-js',
},
},
},
},
optimizeDeps: {
disabled: true,
exclude: ['node_modules', '@supabase/supabase-js'],
},
ssr: {
external: ['node_modules', '@supabase/supabase-js'],
},
})
Built server.js has traces of supabase being bundles into the file and also its dependecies as well.
import manifestJSON from '__STATIC_CONTENT_MANIFEST';
import Stream from 'stream';
import http from 'http';
import Url from 'url';
import require$$0$2 from 'punycode';
import https from 'https';
import zlib from 'zlib';
import require$$2 from 'events';
import require$$0$3 from 'tty';
import require$$1$1 from 'util';
import require$$3 from 'fs';
import require$$4 from 'net';
import require$$0$5 from 'crypto';
...
import manifestJSON from '__STATIC_CONTENT_MANIFEST';
import Stream from 'stream';
import http from 'http';
import Url from 'url';
import require$$0$2 from 'punycode';
import https from 'https';
import zlib from 'zlib';
import require$$2 from 'events';
import require$$0$3 from 'tty';
import require$$1$1 from 'util';
import require$$3 from 'fs';
import require$$4 from 'net';
import require$$0$5 from 'crypto';
...
I need to end up with server simply having depencies imported as:
import {createServer} from '@supabase/supabase-js'
import {createServer} from '@supabase/supabase-js'
Any help would be greatly appreciated.
2 replies