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

fix: update the first workflow to the latest version #1

Closed
wants to merge 1 commit into from

Conversation

HairlessVillager
Copy link
Contributor

The code in the documentation is outdated. When I paste the code from the original documentation and run pnpm run build:dev, it will report an error:

Output
> eko-browser-extension@1.0.0 build:dev C:\Users\hlsvillager\Desktop\eko\browser-extension-demo
> webpack --config webpack/webpack.dev.js

assets by path ../ 126 KiB
  assets by path ../eko/ 41 KiB
    assets by path ../eko/script/*.js 27.2 KiB 5 assets
    + 2 assets
  assets by path ../*.html 450 bytes
    asset ../popup.html 246 bytes [emitted] [from: public/popup.html] [copied]
    asset ../options.html 204 bytes [emitted] [from: public/options.html] [copied]
  asset ../icon.ico 84 KiB [emitted] [from: public/icon.ico] [copied]
  asset ../manifest.json 894 bytes [emitted] [from: public/manifest.json] [copied]
assets by path *.js 8.07 MiB
  asset vendor.js 8 MiB [emitted] (name: vendor) (id hint: vendors)
  asset options.js 37.2 KiB [emitted] (name: options)
  asset popup.js 33.5 KiB [emitted] (name: popup)
  asset background.js 2.29 KiB [emitted] (name: background)
  asset content_script.js 161 bytes [emitted] (name: content_script)
Entrypoint popup 8.03 MiB = vendor.js 8 MiB popup.js 33.5 KiB
Entrypoint options 8.03 MiB = vendor.js 8 MiB options.js 37.2 KiB
Entrypoint background 2.29 KiB = background.js
Entrypoint content_script 161 bytes = content_script.js
orphan modules 4.66 MiB [orphan] 2352 modules
runtime modules 10.2 KiB 20 modules
cacheable modules 2.56 MiB
  modules by path ./node_modules/.pnpm/ 2.55 MiB 578 modules
  modules by path ./src/ 8.45 KiB
    ./src/popup/index.tsx 3.83 KiB [built] [code generated]
    ./src/options/index.tsx 4.58 KiB [built] [code generated]
    ./src/background/index.ts 39 bytes [built] [code generated] [1 error]
    ./src/content/index.ts 1 bytes [built] [code generated]

ERROR in ./src/background/index.ts
Module build failed (from ./node_modules/.pnpm/ts-loader@8.4.0_typescript@5.7.3_webpack@5.97.1/node_modules/ts-loader/index.js):
Error: TypeScript emitted no output for C:\Users\hlsvillager\Desktop\eko\browser-extension-demo\src\background\index.ts.
    at makeSourceMapAndFinish (C:\Users\hlsvillager\Desktop\eko\browser-extension-demo\node_modules\.pnpm\ts-loader@8.4.0_typescript@5.7.3_webpack@5.97.1\node_modules\ts-loader\dist\index.js:53:18)
    at successLoader (C:\Users\hlsvillager\Desktop\eko\browser-extension-demo\node_modules\.pnpm\ts-loader@8.4.0_typescript@5.7.3_webpack@5.97.1\node_modules\ts-loader\dist\index.js:40:5)
    at Object.loader (C:\Users\hlsvillager\Desktop\eko\browser-extension-demo\node_modules\.pnpm\ts-loader@8.4.0_typescript@5.7.3_webpack@5.97.1\node_modules\ts-loader\dist\index.js:23:5)

ERROR in C:\Users\hlsvillager\Desktop\eko\browser-extension-demo\src\background\index.ts
./src/background/index.ts 3:9-21
[tsl] ERROR in C:\Users\hlsvillager\Desktop\eko\browser-extension-demo\src\background\index.ts(3,10)
      TS2305: Module '"./first_workflow"' has no exported member 'run_workflow'.

webpack 5.97.1 compiled with 2 errors in 9678 ms
 ELIFECYCLE  Command failed with exit code 1.

However, I found that there was no need to paste the code actually, because the file already contained code that was functional. Therefore, I revised the documentation and added relevant instructions.

Additionally, perhaps we could consider adding a community guideline: Any pull request (PR) that modifies code should also modify the corresponding documentation to avoid inconsistencies between code behavior and documentation.

@HairlessVillager
Copy link
Contributor Author

HairlessVillager commented Jan 24, 2025

Closed as the docs has been fixed.

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

Successfully merging this pull request may close these issues.

1 participant