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

Legacy Edge: 'Something went wrong' #803

Closed
popeadam opened this issue Feb 24, 2021 · 9 comments
Closed

Legacy Edge: 'Something went wrong' #803

popeadam opened this issue Feb 24, 2021 · 9 comments
Assignees
Labels
v4 version 4

Comments

@popeadam
Copy link

Version used
v.4

Describe the bug
When using Edge (the legacy version, not Chromium), all search web parts are returning a 'Something went wrong' error.

To Reproduce

  1. Implement search webparts v.4.0.0 in any browser other than Edge (legacy)
  2. Check they all work; grand!
  3. Open your page in Edge (not the Chromium version)
  4. See errors below (in webpart, console, and sharepoint console):

In the web part:

Something went wrong
If the problem persists, contact the site administrator and give them the information in Technical Details.
Technical Details
[SPLoaderError.loadComponentError]:
Failed to load component "544c1372-7e5a-49ec-8db6-812f76c375f2" (pnpSearchBoxWebPart). Original error: Failed to load entry point from component "544c1372-7e5a-49ec-8db6-812f76c375f2" (pnpSearchBoxWebPart). Original error: Error loading https://component-id.invalid/544c1372-7e5a-49ec-8db6-812f76c375f2_4.0.0
https://component-id.invalid/544c1372-7e5a-49ec-8db6-812f76c375f2_4.0.0 did not call System.register or AMD define. If loading a global module configure the global name via the meta exports property for script injection support.

INNERERROR:
Failed to load entry point from component "544c1372-7e5a-49ec-8db6-812f76c375f2" (pnpSearchBoxWebPart). Original error: Error loading https://component-id.invalid/544c1372-7e5a-49ec-8db6-812f76c375f2_4.0.0
https://component-id.invalid/544c1372-7e5a-49ec-8db6-812f76c375f2_4.0.0 did not call System.register or AMD define. If loading a global module configure the global name via the meta exports property for script injection support.
CALLSTACK:
Error
at t (https://modern.akamai.odsp.cdn.office.net/files/sp-client/sp-pages-assembly_en-gb_3bd41198ddcc4fb60ad4cb3b908ba56b.js:65:19744)
at t (https://modern.akamai.odsp.cdn.office.net/files/sp-client/sp-pages-assembly_en-gb_3bd41198ddcc4fb60ad4cb3b908ba56b.js:65:164849)
at e.buildErrorWithVerboseLog (https://modern.akamai.odsp.cdn.office.net/files/sp-client/sp-pages-assembly_en-gb_3bd41198ddcc4fb60ad4cb3b908ba56b.js:65:202170)
at e.buildLoadComponentError (https://modern.akamai.odsp.cdn.office.net/files/sp-client/sp-pages-assembly_en-gb_3bd41198ddcc4fb60ad4cb3b908ba56b.js:65:198209)
at Anonymous function (https://modern.akamai.odsp.cdn.office.net/files/sp-client/chunk.systemjs-component-loader_en-us_e9a67ba8f78a23d77103.js:1:66051)

In the browser console:

8 SCRIPT5018: SCRIPT5018: Unexpected quantifier
modern-search-box-web-part_9074f229281a1cf1383d2638f9abb400.js (1,299943)

0: Failed to load component "544c1372-7e5a-49ec-8db6-812f76c375f2" (pnpSearchBoxWebPart). Original error: Failed to load entry point from component "544c1372-7e5a-49ec-8db6-812f76c375f2" (pnpSearchBoxWebPart). Original error: Error loading https://relative-path.invalid/tslib as "tslib" from https://component-id.invalid/544c1372-7e5a-49ec-8db6-812f76c375f2_4.0.0
Unable to load script https://relative-path.invalid/tslib
sp-pages-assembly_en-gb_3bd41198ddcc4fb60ad4cb3b908ba56b.js (64,212294)

0: Failed to load component "544c1372-42df-47c3-94d6-017428cd2baf" (pnpSearchResultsWebPart). Original error: Failed to load entry point from component "544c1372-42df-47c3-94d6-017428cd2baf" (pnpSearchResultsWebPart). Original error: Error loading https://relative-path.invalid/tslib as "tslib" from https://component-id.invalid/544c1372-42df-47c3-94d6-017428cd2baf_4.0.0
Unable to load script https://relative-path.invalid/tslib
sp-pages-assembly_en-gb_3bd41198ddcc4fb60ad4cb3b908ba56b.js (64,212294)

2CSP14317: Ignoring 'unsafe-inline' for directive 'script-src' in Content-Security-Policy because nonce or hash value is specified.

HTTP500: SERVER ERROR - The server encountered an unexpected condition that prevented it from fulfilling the request.
(XHR)GET - https://tenant.sharepoint.com/_api/search/query?QueryText='*'&QueryTemplate='(%7Bsearchterms%7D)%20ContentTypeId%3A0x0101009D1CB255DA76424F860D91F20E6C4118*%20AND%20PromotedState%3A2%20AND%20Path%3A%22https%3A%2F%2Ftenant.sharepoint.com%2Fsites%2FBCC-CWG%2F%22%20AND%20(SPTranslationLanguage%3Aen-us%20OR(NOT%20SPTranslatedLanguages%3Aen-us%20AND%20NOT%20SPIsTranslation%3Atrue))'&HitHighlightedProperties='Title'&StartRow=0&RowLimit=100&Properties='ClientFunction%3ANews%2CEnableMultiGeoSearch%3Afalse'&sortlist='LastModifiedTime%3Adescending'&SelectProperties='ContentClass%2CContentTypeId%2CDefaultEncodingURL%2CDocId%2CEditorOWSUSER%2CFileExtension%2CGeoLocationSource%2CLastModifiedTime%2CModifiedBy%2CPath%2CSPWebUrl%2CSecondaryFileExtension%2CServerRedirectedUrl%2CSiteId%2CTitle%2CUniqueId%2CWebId'&ClientType='TeamSiteSearch'&EnableQueryRules=false&suxrid=ms-oil-datasource-search-news-suggestions

In the Sharepoint console:

2021/02/24 13:25:35.010errorMySiteCache.Page has not yet g
2021/02/24 13:25:35.512errorOtherGlobalError.window.onerroError:Unexpected quantifier, file:https://tenant.sharepoint.com/sites/LiveAppCatalog/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-box-web-part_9074f229281a1cf1383d2638f9abb400.js, line:1, column:299943
2021/02/24 13:25:35.541errorOtherGlobalError.window.onerroError:Unexpected quantifier, file:https://tenant.sharepoint.com/sites/LiveAppCatalog/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-box-web-part_9074f229281a1cf1383d2638f9abb400.js, line:1, column:299943
2021/02/24 13:25:35.659errorOtherGlobalError.window.onerroError:Unexpected quantifier, file:https://tenant.sharepoint.com/sites/LiveAppCatalog/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-results-web-part_3ca3954ff7cd63af5ad33d2a16997f6d.js, line:1, column:2179837
2021/02/24 13:25:35.711errorOtherGlobalError.window.onerroError:Unexpected quantifier, file:https://tenant.sharepoint.com/sites/LiveAppCatalog/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-box-web-part_9074f229281a1cf1383d2638f9abb400.js, line:1, column:299943
2021/02/24 13:25:35.881errorOtherGlobalError.window.onerroError:Unexpected quantifier, file:https://tenant.sharepoint.com/sites/LiveAppCatalog/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-results-web-part_3ca3954ff7cd63af5ad33d2a16997f6d.js, line:1, column:2179837
2021/02/24 13:25:36.147errorOtherGlobalError.window.onerroError:Unexpected quantifier, file:https://tenant.sharepoint.com/sites/LiveAppCatalog/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-box-web-part_9074f229281a1cf1383d2638f9abb400.js, line:1, column:299943
2021/02/24 13:25:36.256errorOtherGlobalError.window.onerroError:Unexpected quantifier, file:https://tenant.sharepoint.com/sites/LiveAppCatalog/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-results-web-part_3ca3954ff7cd63af5ad33d2a16997f6d.js, line:1, column:2179837
2021/02/24 13:25:36.714errorOtherGlobalError.window.onerroError:Unexpected quantifier, file:https://tenant.sharepoint.com/sites/LiveAppCatalog/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-results-web-part_3ca3954ff7cd63af5ad33d2a16997f6d.js, line:1, column:2179837
2021/02/24 13:25:38.378errorSPComponentLoader.loadComponenAttempted to load component "544c1372-7e5a-49ec-8db6-812f76c375f2" (pnpSearchBoxWebPart) 3 times without success.
2021/02/24 13:25:38.686errorSPComponentLoader.loadComponenAttempted to load component "544c1372-42df-47c3-94d6-017428cd2baf" (pnpSearchResultsWebPart) 3 times without success.
2021/02/24 13:25:40.969errorSPComponentLoader.loadComponenAttempted to load component "544c1372-7e5a-49ec-8db6-812f76c375f2" (pnpSearchBoxWebPart) 3 times without success.
2021/02/24 13:25:42.038errorSPComponentLoader.loadComponenAttempted to load component "544c1372-42df-47c3-94d6-017428cd2baf" (pnpSearchResultsWebPart) 3 times without success.
2021/02/24 13:25:43.826errorSPComponentLoader.loadComponenAttempted to load component "544c1372-7e5a-49ec-8db6-812f76c375f2" (pnpSearchBoxWebPart) 3 times without success.
2021/02/24 13:25:43.847errorWebPartZone.LoadWebPartFailed to load component "544c1372-7e5a-49ec-8db6-812f76c375f2" (pnpSearchBoxWebPart). Original error: Failed to load entry point from component "544c1372-7e5a-49ec-8db6-812f76c375f2" (pnpSearchBoxWebPart). Original error: Error loading https://relative-path.invalid/tslib as "tslib" from https://component-id.invalid/544c1372-7e5a-49ec-8db6-812f76c375f2_4.0.0 Unable to load script https://relative-path.invalid/tslib
2021/02/24 13:25:44.268errorSPComponentLoader.loadComponenAttempted to load component "544c1372-42df-47c3-94d6-017428cd2baf" (pnpSearchResultsWebPart) 3 times without success.
2021/02/24 13:25:44.280errorWebPartZone.LoadWebPartFailed to load component "544c1372-42df-47c3-94d6-017428cd2baf" (pnpSearchResultsWebPart). Original error: Failed to load entry point from component "544c1372-42df-47c3-94d6-017428cd2baf" (pnpSearchResultsWebPart). Original error: Error loading https://relative-path.invalid/tslib as "tslib" from https://component-id.invalid/544c1372-42df-47c3-94d6-017428cd2baf_4.0.0 Unable to load script https://relative-path.invalid/tslib

Expected behavior
Web parts should load without error

Screenshots

Working in Chrome and Edge Chromium:

image

Experience in Edge (legacy):

image

Desktop (please complete the following information):

  • Browser: Edge (legacy)

Additional context

@wobba
Copy link
Collaborator

wobba commented Feb 24, 2021

This falls under IE11 as that gives the same error. If someone want to figure out which part fail and how to fix it we'll consider adding this, but not a priority.

Took a quick look and seems the use of back tick ` in one of the language resource files can be the culprit as this fails for the label RefinementFiltersDescription.

@popeadam
Copy link
Author

Thanks, @wobba , would love to help but I've limited programming skills. If no solution is planned do we need to update the 'supported browsers' documentation if Microsoft Edge is prioritised at the same level as IE11?

@wobba
Copy link
Collaborator

wobba commented Feb 24, 2021

Good point... Edge is a bastard browser ;) I'll take a look at it and either make it work or change the docs.

@wobba wobba self-assigned this Feb 24, 2021
@wobba
Copy link
Collaborator

wobba commented Feb 28, 2021

@FranckyC I think the issue is related to the regex private genericTokenRegexp: RegExp = /(?<!\\){[^\{]*?}(?!\\)/gi; in TokenService.ts which uses look-behind. Can you explain the regex with a sample in addition to the comment above to easier understand what it tried to match. If you look at the sample, should the last one match the espaced } at the end?

image

@wobba wobba added the v4 version 4 label Feb 28, 2021
@FranckyC
Copy link
Collaborator

FranckyC commented Mar 9, 2021

@wobba this RegExp is used to match the tokens in a expression. Because of the escape feature (\{) we need to make sure the first/last { or } are not preceded or followed by \ (i.e. escape character). The initial issue was regarding the DepartmentId property and the necessity to escape curly braces.

@FranckyC
Copy link
Collaborator

FranckyC commented Mar 9, 2021

Feel free to propose an improved regex without the need to use negative lookbehind. RegExps are definitely not my friends ;)

@wobba
Copy link
Collaborator

wobba commented Mar 9, 2021

@FranckyC can you explain what the existing tries to match with a full template example, then I'll give it a shot.. regex being my middle name 😉 If you look at the screenshot I pasted, which ones should it match and not?

@wobba
Copy link
Collaborator

wobba commented Mar 18, 2021

The regex could be simplified, but then I got a new error Cannot redefine non-configurable property 'options' which I cannot really pinpoint where happens. So I'll leave the regex for now. Maybe revisit this some other time. Debugging in IE11 is not super easy either.

@stevebeauge
Copy link
Contributor

Hi @wobba, I submitted a PR to fix legacy Edge.
I'm not sure where you got the Cannot redefine non-configurable property 'options' error you mentionned to check if it's ok

wobba added a commit that referenced this issue Apr 23, 2021
fix regex in tokenservice.ts that broke legacy edge. Fix #803
@wobba wobba closed this as completed Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v4 version 4
Projects
None yet
Development

No branches or pull requests

4 participants