Skip to content

Commit

Permalink
chore: Force single resolution for core modules, infinite loop guard (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tgriesser authored Nov 2, 2021
1 parent 8a813a6 commit e3720df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export const namedRouteExchange: Exchange = ({ client, forward }) => {
return forward(pipe(
ops$,
map((o) => {
if (!o.context.url.endsWith('/graphql')) {
throw new Error(`Infinite loop detected? Ping @tgriesser to help debug`)
}

return {
...o,
context: {
Expand Down
16 changes: 15 additions & 1 deletion packages/frontend-shared/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,21 @@ export const makeConfig = (config: Partial<UserConfig> = {}, plugins: PluginOpti
},
},

resolve: { alias },
resolve: {
alias,
dedupe: [
'vue',
'@vue/compiler-core',
'@vue/compiler-dom',
'@vue/compiler-sfc',
'@vueuse/core',
'@urql/core',
'@urql/devtools',
'@urql/exchange-execute',
'@urql/exchange-graphcache',
'@urql/vue',
],
},

// You cannot add or remove arbitrary options from shared plugins.
// Please use the PluginsOverride option for this.
Expand Down

0 comments on commit e3720df

Please sign in to comment.