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

The browser sample does not refresh when code is updated #90

Closed
trivikr opened this issue Aug 7, 2021 · 2 comments · Fixed by #91
Closed

The browser sample does not refresh when code is updated #90

trivikr opened this issue Aug 7, 2021 · 2 comments · Fixed by #91

Comments

@trivikr
Copy link
Contributor

trivikr commented Aug 7, 2021

Describe the bug
The browser sample does not refresh when code is updated.

To Reproduce
Follow steps for browser https://github.com/aws-samples/aws-sdk-js-tests#browser

  • Make some modification in code and save. For example, add Limit while calling listTables:
 const getV2Response = async (clientParams) => {
   const client = new AWS.DynamoDB(clientParams);
-  return client.listTables().promise();
+  return client.listTables({ Limit: 1 }).promise();
 };
 
 const getV3Response = async (clientParams) => {
   const client = new DynamoDB(clientParams);
-  return client.listTables({});
+  return client.listTables({ Limit: 1 });
 };
  • Note that the browser page does not reload, and have to be manually reloaded.

Expected behavior
The page opened in browser should reload when code is changed in the repository.

@trivikr
Copy link
Contributor Author

trivikr commented Aug 7, 2021

This bug was introduced when we switched from webpack to esbuild in #88

We're using native esbuild serve API which does not yet support hot module reloading.

@trivikr
Copy link
Contributor Author

trivikr commented Aug 7, 2021

One solution is to write custom esbuild config to watch and bundle files, and use third party server to hot reload.

Example: https://github.com/zaydek/esbuild-hot-reload

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 a pull request may close this issue.

1 participant