Skip to content

Commit

Permalink
skip wasm source map consumption on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Sep 8, 2022
1 parent 1fde5a7 commit f396c41
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
6 changes: 5 additions & 1 deletion packages/driver/src/cypress/script_utils.ts
Expand Up @@ -17,7 +17,11 @@ const extractSourceMap = ([script, contents]) => {
const sourceMap = $sourceMapUtils.extractSourceMap(script, contents)

return $sourceMapUtils.initializeSourceMapConsumer(script, sourceMap)
.return([script, contents])
.catch((_err) => {
// if WebAssembly is missing, we can't consume source maps, but it shouldn't block Cy
// like in WebKit on Windows: https://github.com/microsoft/playwright/issues/2876
})
.then(() => [script, contents])
}

const evalScripts = (specWindow, scripts: any = []) => {
Expand Down
13 changes: 6 additions & 7 deletions packages/driver/src/cypress/source_map_utils.ts
@@ -1,6 +1,5 @@
import _ from 'lodash'
import { SourceMapConsumer } from 'source-map'
import Promise from 'bluebird'

// @ts-ignore
import mappingsWasm from 'source-map/lib/mappings.wasm'
Expand All @@ -12,19 +11,19 @@ const regexDataUrl = /data:[^;\n]+(?:;charset=[^;\n]+)?;base64,([a-zA-Z0-9+/]+={

let sourceMapConsumers = {}

const initializeSourceMapConsumer = (file, sourceMap) => {
if (!sourceMap) return Promise.resolve(null)
const initializeSourceMapConsumer = async (file, sourceMap) => {
if (!sourceMap) return null

// @ts-ignore
SourceMapConsumer.initialize({
'lib/mappings.wasm': mappingsWasm,
})

return Promise.resolve(new SourceMapConsumer(sourceMap)).then((consumer) => {
sourceMapConsumers[file.fullyQualifiedUrl] = consumer
const consumer = await new SourceMapConsumer(sourceMap)

return consumer
})
sourceMapConsumers[file.fullyQualifiedUrl] = consumer

return consumer
}

const extractSourceMap = (file, fileContents) => {
Expand Down

5 comments on commit f396c41

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on f396c41 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/linux-x64/webkit-experimental-f396c4100d8da840c2756ee791cc5f7e7f25ad15/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on f396c41 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/linux-arm64/webkit-experimental-f396c4100d8da840c2756ee791cc5f7e7f25ad15/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on f396c41 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/darwin-arm64/webkit-experimental-f396c4100d8da840c2756ee791cc5f7e7f25ad15/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on f396c41 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/darwin-x64/webkit-experimental-f396c4100d8da840c2756ee791cc5f7e7f25ad15/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on f396c41 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/win32-x64/webkit-experimental-f396c4100d8da840c2756ee791cc5f7e7f25ad15/cypress.tgz

Please sign in to comment.