Skip to content

Commit bdea5fd

Browse files
authored
fix: Windows paths for custom client configuration files (#510)
1 parent 3a9b90d commit bdea5fd

File tree

5 files changed

+56
-1
lines changed

5 files changed

+56
-1
lines changed

lib/core/options.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import merge from 'lodash.mergewith'
2+
// @ts-ignore
3+
import { relativeTo } from '@nuxt/utils'
24
import * as Integrations from '@sentry/integrations'
35
import { canInitialize } from './utils'
46

@@ -124,6 +126,7 @@ export async function resolveClientOptions (moduleContainer, moduleOptions, logg
124126
let clientConfigPath
125127
if (typeof (options.clientConfig) === 'string') {
126128
clientConfigPath = moduleContainer.nuxt.resolver.resolveAlias(options.clientConfig)
129+
clientConfigPath = relativeTo(moduleContainer.options.buildDir, clientConfigPath)
127130
} else {
128131
options.config = merge(options.config, options.clientConfig)
129132
}
@@ -143,6 +146,7 @@ export async function resolveClientOptions (moduleContainer, moduleOptions, logg
143146
if (options.customClientIntegrations) {
144147
if (typeof (options.customClientIntegrations) === 'string') {
145148
customClientIntegrations = moduleContainer.nuxt.resolver.resolveAlias(options.customClientIntegrations)
149+
customClientIntegrations = relativeTo(moduleContainer.options.buildDir, customClientIntegrations)
146150
} else {
147151
logger.warn(`Invalid customClientIntegrations option. Expected a file path, got "${typeof (options.customClientIntegrations)}".`)
148152
}

lib/plugin.client.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/order */
12
import Vue from 'vue'
23
import merge from '~lodash.mergewith'
34
import * as Sentry from '~@sentry/vue'

lib/plugin.lazy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async function attemptLoadSentry (ctx, inject) {
8282

8383
if (!window.<%= globals.nuxt %>) {
8484
<% if (options.dev) { %>
85-
console.warn(`$sentryLoad was called but window.<%= globals.nuxt %> is not available, delaying sentry loading until onNuxtReady callback. Do you really need to use lazy loading for Sentry?`)
85+
console.warn('$sentryLoad was called but window.<%= globals.nuxt %> is not available, delaying sentry loading until onNuxtReady callback. Do you really need to use lazy loading for Sentry?')
8686
<% } %>
8787
<% if (options.lazy.injectLoadHook) { %>
8888
window.<%= globals.readyCallback %>(() => loadSentry(ctx, inject))

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
}
5353
},
5454
"dependencies": {
55+
"@nuxt/utils": "2.x",
5556
"@sentry/integrations": "^7.38.0",
5657
"@sentry/node": "^7.38.0",
5758
"@sentry/vue": "^7.38.0",

yarn.lock

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,24 @@
16751675
ua-parser-js "^0.7.28"
16761676
ufo "^0.7.4"
16771677

1678+
1679+
version "2.16.0"
1680+
resolved "https://registry.yarnpkg.com/@nuxt/utils/-/utils-2.16.0.tgz#dfb7eb2da446e152ff9b382c045a2be172f22407"
1681+
integrity sha512-/6eLMKYn/hFr17HNtcgIHaO1rKqrSfGxABPQCikLIpq/hRcXz0tCQHgwLfG9nEzFyY7fzulPIICjRB9EEEe3tA==
1682+
dependencies:
1683+
consola "^2.15.3"
1684+
create-require "^1.1.1"
1685+
fs-extra "^10.1.0"
1686+
hash-sum "^2.0.0"
1687+
jiti "^1.16.2"
1688+
lodash "^4.17.21"
1689+
proper-lockfile "^4.1.2"
1690+
semver "^7.3.8"
1691+
serialize-javascript "^6.0.1"
1692+
signal-exit "^3.0.7"
1693+
ua-parser-js "^1.0.33"
1694+
ufo "^1.0.1"
1695+
16781696
16791697
version "2.15.8"
16801698
resolved "https://registry.yarnpkg.com/@nuxt/vue-app/-/vue-app-2.15.8.tgz#46b7ec8fc93f8d1f4cdf4f6b04134cb40ceb7c4a"
@@ -6171,6 +6189,15 @@ from2@^2.1.0:
61716189
inherits "^2.0.1"
61726190
readable-stream "^2.0.0"
61736191

6192+
fs-extra@^10.1.0:
6193+
version "10.1.0"
6194+
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
6195+
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
6196+
dependencies:
6197+
graceful-fs "^4.2.0"
6198+
jsonfile "^6.0.1"
6199+
universalify "^2.0.0"
6200+
61746201
fs-extra@^8.1.0:
61756202
version "8.1.0"
61766203
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
@@ -7942,6 +7969,11 @@ jest@^29.3.1:
79427969
import-local "^3.0.2"
79437970
jest-cli "^29.3.1"
79447971

7972+
jiti@^1.16.2:
7973+
version "1.17.1"
7974+
resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.17.1.tgz#264daa43ee89a03e8be28c3d712ccc4eb9f1e8ed"
7975+
integrity sha512-NZIITw8uZQFuzQimqjUxIrIcEdxYDFIe/0xYfIlVXTkiBjjyBEvgasj5bb0/cHtPRD/NziPbT312sFrkI5ALpw==
7976+
79457977
jiti@^1.9.2:
79467978
version "1.16.0"
79477979
resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.16.0.tgz#f72065954446ad1866fa8d6bcc3bed3cc1cebdaa"
@@ -11228,6 +11260,13 @@ serialize-javascript@^6.0.0:
1122811260
dependencies:
1122911261
randombytes "^2.1.0"
1123011262

11263+
serialize-javascript@^6.0.1:
11264+
version "6.0.1"
11265+
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c"
11266+
integrity sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==
11267+
dependencies:
11268+
randombytes "^2.1.0"
11269+
1123111270
serve-placeholder@^1.2.3:
1123211271
version "1.2.4"
1123311272
resolved "https://registry.yarnpkg.com/serve-placeholder/-/serve-placeholder-1.2.4.tgz#513eac9c435272c7fe9a86612c852ae9b1467fd4"
@@ -12255,6 +12294,11 @@ ua-parser-js@^0.7.28:
1225512294
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.32.tgz#cd8c639cdca949e30fa68c44b7813ef13e36d211"
1225612295
integrity sha512-f9BESNVhzlhEFf2CHMSj40NWOjYPl1YKYbrvIr/hFTDEmLq7SRbWvm7FcdcpCYT95zrOhC7gZSxjdnnTpBcwVw==
1225712296

12297+
ua-parser-js@^1.0.33:
12298+
version "1.0.33"
12299+
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.33.tgz#f21f01233e90e7ed0f059ceab46eb190ff17f8f4"
12300+
integrity sha512-RqshF7TPTE0XLYAqmjlu5cLLuGdKrNu9O1KLA/qp39QtbZwuzwv1dT46DZSopoUMsYgXpB3Cv8a03FI8b74oFQ==
12301+
1225812302
ufo@^0.7.4:
1225912303
version "0.7.11"
1226012304
resolved "https://registry.yarnpkg.com/ufo/-/ufo-0.7.11.tgz#17defad497981290383c5d26357773431fdbadcb"
@@ -12265,6 +12309,11 @@ ufo@^1.0.0:
1226512309
resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.0.1.tgz#64ed43b530706bda2e4892f911f568cf4cf67d29"
1226612310
integrity sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==
1226712311

12312+
ufo@^1.0.1:
12313+
version "1.1.1"
12314+
resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.1.1.tgz#e70265e7152f3aba425bd013d150b2cdf4056d7c"
12315+
integrity sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==
12316+
1226812317
uglify-js@^3.1.4, uglify-js@^3.5.1:
1226912318
version "3.17.4"
1227012319
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c"

0 commit comments

Comments
 (0)