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

Unable to publish the static website #181

Closed
A-5ingh opened this issue May 20, 2021 · 9 comments
Closed

Unable to publish the static website #181

A-5ingh opened this issue May 20, 2021 · 9 comments
Assignees
Labels

Comments

@A-5ingh
Copy link

A-5ingh commented May 20, 2021

Describe the bug
After cloning the paperbits-demo git repo and following the steps mentioned in wiki to publish the modified content. npm run publish command is failing with below error.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repo - https://github.com/paperbits/paperbits-demo.git
  2. Install npm packages - npm install
  3. Execute npm run start, open browser and navigate to http://localhost:8080/
  4. Make any changes to the UI and save the demo.json file.
  5. Replace the file in /src/data/demo.json file with the file saved in step 4.
  6. Execute npm run publish. This command fails with: ERROR in ./node_modules/@paperbits/core/map/map.publish.module.ts

Expected behavior
npm run publish should generate a static website in ./dist/website/ folder of the project.

Screenshots
Not applicable

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Safari
  • Version: 14.1

Additional context
Stack trace:
ERROR in ./node_modules/@paperbits/core/map/map.publish.module.ts
Module not found: Error: Can't resolve './bindingHandlers.googlemap' in '/Users/asingh/Desktop/Projects/paperbits.io/paperbits-demo/node_modules/@paperbits/core/map'
@ ./node_modules/@paperbits/core/map/map.publish.module.ts 4:0-38
@ ./node_modules/@paperbits/core/core.publish.module.ts
@ ./src/startup.publish.ts
@ multi ./src/startup.publish.ts

@azaslonov azaslonov self-assigned this May 22, 2021
@azaslonov azaslonov added the bug label May 22, 2021
@azaslonov
Copy link
Member

Fixed. Can you please try to grab the latest version from master branch, do npm install and npm start again?
Feel free to re-open the issue if the problem persists.

@A-5ingh
Copy link
Author

A-5ingh commented May 23, 2021

Sure, I'll test it and let you.

@A-5ingh
Copy link
Author

A-5ingh commented May 23, 2021

@azaslonov I think removing node-sass package has broken some other functionality now.
npm install works fine but after that npm start is failing now with the below error:

ERROR in ./src/themes/website/styles/styles.design.scss
    Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
    ModuleError: Module Error (from ./node_modules/sass-loader/dist/cjs.js):
    Cannot find module 'sass'

Please let me know if you need more details or error stack.
P.S. I'm unable to re-open this issue. Do I need to open a new issue for the above error ?

@azaslonov
Copy link
Member

Could you please try cleaning up node_modules completely and redo npm install?

@A-5ingh
Copy link
Author

A-5ingh commented May 23, 2021

Could you please try cleaning up node_modules completely and redo npm install?

Already did that and I have also tried by cloning the repo to a completely new folder.

@azaslonov azaslonov reopened this May 24, 2021
@azaslonov
Copy link
Member

azaslonov commented May 24, 2021

Hmm, still cannot reproduce the issue. Just tried to run everything from scratch:

  1. cloned repo to the newly created folder
  2. started designer
  3. added a Map widget to the page
  4. saved the demo.json file and replaced the existing one with it
  5. published website and checked the page

Everything seems to be working for me. So, can you please give me more details, like:

  • your OS (and version)
  • version of NodeJS
  • full log of your script execution
  • did you do any changes to the build script? if yes, what exactly?
  • just to make sure, you're using the latest 0.1.419 version?
  • if possible, can you try to repro this on another machine
  • as a last resort, can you also try to npm install sass --save-dev and see if it helps?

@A-5ingh
Copy link
Author

A-5ingh commented May 24, 2021

Hmm, still cannot reproduce the issue. Just tried to run everything from scratch:

  1. cloned repo to the newly created folder
  2. started designer
  3. added a Map widget to the page
  4. saved the demo.json file and replaced the existing one with it
  5. published website and checked the page

Everything seems to be working for me. So, can you please give me more details, like:

  • your OS (and version) - macOS Big Sur, 11.3
  • version of NodeJS - v14.16.0
  • full log of your script execution - I'll share if required in the next comment
  • did you do any changes to the build script? if yes, what exactly? - No change made
  • just to make sure, you're using the latest 0.1.419 version? - Yes, verified in package.json
  • if possible, can you try to repro this on another machine - yes, tried in a windows machine. Same error on npm run
  • as a last resort, can you also try to npm install sass --save-dev and see if it helps? - Yes, this fixed the issue. Both npm run and npm run publish works fine with after install sass package

Thanks for the update @azaslonov.

But I feel the root cause of the issue is sass package only. I have tested the code on two machines (mac and windows), with latest code and cloning to a new folder.
I believe you have sass package installed globally in your system thats why you are not running into this error.

@azaslonov
Copy link
Member

Yep, you were right, my global cache had it. Pushed the fix, please try to grab the latest one.

@A-5ingh
Copy link
Author

A-5ingh commented May 25, 2021

@azaslonov Yea finally both commands are working fine. There is one webpack warning on publish command but that should be fine for now. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants