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

wrangler-action failing since wrangler 1.14.0 - "Error: Cannot find module 'webpack'" #50

Closed
0x15f opened this issue Mar 5, 2021 · 5 comments

Comments

@0x15f
Copy link

0x15f commented Mar 5, 2021

Since wrangler 1.14.0 any workers configured to use webpack using the wrangler-action fail.

/usr/bin/docker run --name e478d2379fc5c846f8ba82b651625ce8d5_098a67 --label 5588e4 --workdir /github/workspace --rm -e INPUT_APITOKEN -e INPUT_APIKEY -e INPUT_EMAIL -e INPUT_ENVIRONMENT -e INPUT_WORKINGDIRECTORY -e INPUT_WRANGLERVERSION -e INPUT_SECRETS -e INPUT_PRECOMMANDS -e INPUT_POSTCOMMANDS -e INPUT_PUBLISH -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/dimebeauty-discount-worker/dimebeauty-discount-worker":"/github/workspace" 5588e4:78d2379fc5c846f8ba82b651625ce8d5
Using API Token authentication
/usr/local/bin/wrangler -> /usr/local/lib/node_modules/@cloudflare/wrangler/run-wrangler.js

> @cloudflare/wrangler@1.14.1 postinstall /usr/local/lib/node_modules/@cloudflare/wrangler
> node ./install-wrangler.js

Downloading release from https://workers.cloudflare.com/get-npm-wrangler-binary/1.14.1/x86_64-unknown-linux-musl
wrangler has been installed!
+ @cloudflare/wrangler@1.14.1
added 23 packages from 10 contributors in 2.954s
added 18 packages from 49 contributors and audited 18 packages in 1.05s
found 0 vulnerabilities

  Installing wranglerjs v1.14.1...
internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module 'webpack'
Require stack:
- /github/workspace/.cache/.wrangler/wranglerjs-1.14.1/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/github/workspace/.cache/.wrangler/wranglerjs-1.14.1/index.js:1:17)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/github/workspace/.cache/.wrangler/wranglerjs-1.14.1/index.js' ]
}
Error: failed to execute `"/usr/local/bin/node" "/github/workspace/.cache/.wrangler/wranglerjs-1.14.1" "--output-file=/tmp/.wranglerjs_outputqBrxG" "--wasm-binding=WASM_MODULE" "--no-webpack-config=1" "--use-entry=/github/workspace/index.js"`: exited with exit code: 1
@jasikpark
Copy link

I've received the same error.



Error: Cannot find module 'webpack/lib/wasm/WasmMainTemplatePlugin'
Require stack:
- /github/workspace/.cache/.wrangler/wranglerjs-1.14.1/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/github/workspace/.cache/.wrangler/wranglerjs-1.14.1/index.js:4:32)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/github/workspace/.cache/.wrangler/wranglerjs-1.14.1/index.js' ]
}
Error: failed to execute `"/usr/local/bin/node" "/github/workspace/.cache/.wrangler/wranglerjs-1.14.1" "--output-file=/tmp/.wranglerjs_outputbmVf0" "--wasm-binding=WASM_MODULE" "--webpack-config=webpack.config.js"`: exited with exit code: 1

@jasikpark
Copy link

I set

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    name: Deploy
    steps:
      - uses: actions/checkout@master
      - name: Publish
        uses: cloudflare/wrangler-action@1.3.0
        with:
          apiToken: ${{ secrets.CF_API_TOKEN }}
          wranglerVersion: '1.13.0'

and it builds fine now.

@jasikpark
Copy link

jasikpark commented Mar 6, 2021

It seems to be a problem with 1.14.0 specifically - they rolled back the problematic changes with 1.14.1 in the wrangler repo. I haven’t tested whether upgrading to 1.14.1 in my github action file works...

https://github.com/cloudflare/wrangler/releases/tag/v1.14.1

@jasikpark
Copy link

Nope. 1.14.1 claims to roll back the problematic changes, but I'm still getting an error in my Github Action:


found 0 vulnerabilities

  Installing wranglerjs v1.14.1...
internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module 'webpack/lib/wasm/WasmMainTemplatePlugin'
Require stack:
- /github/workspace/.cache/.wrangler/wranglerjs-1.14.1/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/github/workspace/.cache/.wrangler/wranglerjs-1.14.1/index.js:4:32)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/github/workspace/.cache/.wrangler/wranglerjs-1.14.1/index.js' ]
}
Error: failed to execute `"/usr/local/bin/node" "/github/workspace/.cache/.wrangler/wranglerjs-1.14.1" "--output-file=/tmp/.wranglerjs_outputzPWAh" "--wasm-binding=WASM_MODULE" "--webpack-config=webpack.config.js"`: exited with exit code: 1

@xyeLz
Copy link

xyeLz commented Mar 8, 2021

You are not alone here. I am also experiencing the exact same issue with 1.14.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants