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: build/show dummy component for empty files in order not to abort build /ファイルが空の場合は仮コンポーネントをビルドしてビルドエラーを避ける #209

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vladinomo
Copy link
Contributor

@vladinomo vladinomo commented Feb 15, 2024

Summary 概要

Fix for #199

  • The problem comes from reference to undefined attributes created by parsing empty html/spear files. To avoid it. in case of parsing empty files, the script inserts a dummy component.

Spec

  • shows <div>a component {component name} is empty.</div> on the web page

Another problem

with this change, spear watch won't stop with empty components but logger showing error messages below

[Page]: /index
BadRequestError: Bad Request
    at createHttpError (/Users/name/Documents/projects/spear/packages/spear-cli/node_modules/send/index.js:979:12)
    at SendStream.error (/Users/name/Documents/projects/spear/packages/spear-cli/node_modules/send/index.js:270:31)
    at SendStream.pipe (/Users/name/Documents/projects/spear/packages/spear-cli/node_modules/send/index.js:516:10)
    at /Users/name/Documents/projects/spear/packages/spear-cli/node_modules/live-server/index.js:97:5
    at call (/Users/name/Documents/projects/spear/packages/spear-cli/node_modules/connect/index.js:239:7)
    at next (/Users/name/Documents/projects/spear/packages/spear-cli/node_modules/connect/index.js:183:5)
    at Function.handle (/Users/name/Documents/projects/spear/packages/spear-cli/node_modules/connect/index.js:186:3)
    at Server.app (/Users/name/Documents/projects/spear/packages/spear-cli/node_modules/connect/index.js:51:37)
    at Server.emit (node:events:390:28)
    at parserOnIncoming (node:_http_server:951:12)

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