extension-examples icon indicating copy to clipboard operation
extension-examples copied to clipboard

`Cannot GET /` without 'public' folder created

Open mingtao13595 opened this issue 2 years ago • 2 comments

Thanks for this great job. Sorry for that easy question which shows Cannot GET / for all the demo applications. I noticed that dist folder can be created by yarn analyze or yarn build how ever no methods was correlated to the public folder? Is it means public folder not neccesary in this project? Also, no command like npx create-react-app my-app was found in each package.json. Here attached the output of yarn develop :

yarn run v1.22.19
$ webpack serve --hot --server-type https --port 8080 --config webpack.develop.js
<i> [webpack-dev-server] SSL certificate: /home/wang/looker-dev/extension-examples/react/javascript/helloworld-js/node_modules/.cache/webpack-dev-server/server.pem
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: https://localhost:8080/, https://127.0.0.1:8080/
<i> [webpack-dev-server] Content not from webpack is served from '/home/wang/looker-dev/extension-examples/react/javascript/helloworld-js/public' directory
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
asset bundle.js 3.82 MiB [emitted] (name: app) 1 related asset
orphan modules 3.08 MiB [orphan] 868 modules
runtime modules 26.3 KiB 13 modules
cacheable modules 3.18 MiB
  modules by path ../../../node_modules/ 3.17 MiB 661 modules
  modules by path ./src/*.js 6.15 KiB
    ./src/index.js 1.63 KiB [built] [code generated]
    ./src/App.js 1.73 KiB [built] [code generated]
    ./src/HelloWorld.js 2.78 KiB [built] [code generated]
webpack 5.69.1 compiled successfully in 5921 ms

mingtao13595 avatar Aug 31 '23 02:08 mingtao13595

You can try https://localhost:8080/bundle.js to see the bundle file. Use this url in the manifest.lkml while developing your app. Have a read through this docs.

jithinolickal avatar Oct 12 '23 06:10 jithinolickal

The public folder is not necessary for extensions. The Looker extension framework constructs the html to load the extension at runtime and all it needs is the javascript. In development mode the manifest points to the development server dist folder. In production mode you copy the transpiled javascript into the LookML project.

There is a create-looker-extension package but unfortunately its a little out of date. Hopefully it will be updated soon.

bryans99 avatar Nov 29 '23 17:11 bryans99