extension-js / extension.js

🧩 Plug-and-play, zero-config, cross-browser extension development tool.
https://extension.js.org
MIT License
3.62k stars 90 forks source link

--template=tailwind Deleting the chrome_url_overrides configuration in the manifest.json file causes an error #149

Open ApacheAlpha opened 3 weeks ago

ApacheAlpha commented 3 weeks ago

Implementation process

When I create a new project using the template command:

npx extension create test-extensions-tem --template=tailwind

I don't need a page to overlay the Google Chrome homepage,So I deleted the chrome_url_overrides configuration in the manifest.json file

Before deletion

{ "manifest_version": 3, "version": "1.0", "name": "test-extensions-tem", "description": "An extension template using Tailwind. This template includes a new tab override.", "icons": { "16": "public/icons/icon_16.png", "48": "public/icons/icon_48.png" }, "chrome_url_overrides": { "newtab": "newtab/index.html" } }

After deletion

{ "manifest_version": 3, "version": "1.0", "name": "test-extensions-tem", "description": "An extension template using Tailwind. This template includes a new tab override.", "icons": { "16": "public/icons/icon_16.png", "48": "public/icons/icon_48.png" } } After deleting it, I restarted the entire project. When I opened a new tab, it prompted:

截图 2024-08-18 11-20-27

无法访问您的文件该文件可能已被移至别处、修改或删除。ERR_FILE_NOT_FOUND == Unable to access your file The file may have been moved, modified, or deleted. ERR_FILE_NOT_FOUND

Why can't I delete the chrome_url_overrides configuration? How can I solve this problem?

cezaraugusto commented 3 weeks ago

hi @ApacheAlpha thanks for reporting!

it seems a cache thing. what happens when you reload the extension in the browser?

cezaraugusto commented 2 days ago

@ApacheAlpha I did several updates to the project since the last message. Could you try again and let me know if it is still broken? Also, new template names in v2 https://extension.js.org/docs/getting-started/templates

ApacheAlpha commented 1 day ago

@cezaraugusto

Thank you for your hard work on this framework.

Here is my testing process:

First I used the command:

npx extension create test-extensions-new-react --template=new-react

The results are shown in the figure 截图 2024-09-13 18-38-46

I opened the entire project using the Vscode editor and then executed npm run dev

When I open a new browser tab, the entire interface is displayed normally

截图 2024-09-13 18-43-28

I stopped the whole project using Ctrl + C, then went into manifest.json and deleted Configuration

"chrome_url_overrides": { "newtab": "newtab/index.html" },

Then I started the project using the command: npm run dev and I found the first problem

Why is the browser homepage still overwritten in the newly opened tab? I deleted the configuration of overwriting the homepage and ran the command: npm run dev to restart. Is the previously built plugin configuration still effective?

截图 2024-09-13 18-48-58

I think after restart, the files in dist folder are not updated or changed. The dist folder is not the latest extension。Why is this happening?

So I stopped the project, deleted the dist folder under the project folder, and restarted the project again using npm run dev.

When I open a new tab, I get the same problem as before 截图 2024-09-13 18-59-30

To avoid cache issues, I cleared all past browser data, so I don't think it has anything to do with cache.

无法访问您的文件该文件可能已被移至别处、修改或删除。ERR_FILE_NOT_FOUND == Unable to access your file The file may have been moved, modified, or deleted. ERR_FILE_NOT_FOUND

New findings

1、When creating a new project, first delete "chrome_url_overrides": {"newtab": "newtab/index.html"}, then execute npm run dev, the problem mentioned above will not occur. What is the reason?

2、I deleted node_modules and reinstalled it, which also solved the problem mentioned before. Why?

I hope my content is helpful to you